//-----------------------------------------------------------------------------	

//-----------------------------------------------------------------------------	
function showInfo(sType,offsetX,offsetY,event)
{
	document.getElementById(sType).style.visibility = "visible";
	document.getElementById(sType).style.left = document.body.scrollLeft+event.clientX+offsetX; //window.event.clientX;
	document.getElementById(sType).style.top = document.body.scrollTop+event.clientY+offsetY; //window.event.clientY;
}

function hideInfo(sType)
{
	document.getElementById(sType).style.visibility = "hidden";
}
 
function OpenItems(nFileName, nItemCategorieID, nSubCategoryId, nVendorID)
{
 	var iframeContainer, strUrl, re;
	iframeContainer = document.getElementById('iFrameContainer'+nItemCategorieID)
	strUrl = iframeContainer.src;
	if (strUrl.indexOf(nFileName)<0) {
		iframeContainer.src = nFileName+'.asp?itemCategorieID='+nItemCategorieID+'&SubCategoryId='+nSubCategoryId+'&vendorID='+nVendorID;
	}
}

function OpenCommentWindow(nCategory,nID)
{
	placeLeft = screen.width/2-450/2
	placeTop = screen.height/2-350/2
	newWindow = window.open('comment_window.asp?id='+nCategory+'&pid='+nID, 'fraComment', 'TOP='+placeTop+',LEFT='+placeLeft+',width=450,height=350,scrollbars=1');
}
		
function CheckItemSearch()
{
	if (document.Srform.SearchString.value=='')
	{
	  alert("אנא הכנס מילה לחיפוש");
      return false;
	}
	document.Srform.submit()
	return 0;
}
function CheckVendorSelection()
{
	if (document.Srform2.printerID.selectedIndex==0)
	{
	  alert("לא בחרת יצרן");
      return false;
	}
	document.Srform2.submit()
	return 0;
}

//-----------------------------------------------------------------------------
//	OpenPop window 
//-----------------------------------------------------------------------------
function OpenPop(sURL,sName,sWidth,sHeight,sScroll){
	placeLeft = screen.width/2-sWidth/2
	placeTop = screen.height/2-sHeight/2
	var winPrint=window.open(sURL,sName,'TOP='+placeTop+',LEFT='+placeLeft+',WIDTH='+sWidth+',HEIGHT='+sHeight+',resizable=0, status=0, scrollbars='+sScroll);
	winPrint.focus();
}

//--------------------------------------------------------------
//	Item compare
//--------------------------------------------------------------
function addChk()
{
	var allchecked = '';
	$('input[name=chkCompareID]:checked').each(
		function()
		{
				allchecked += ("," + $(this).val());
		}
	)
	$('#CompareID').val(allchecked);
	var display = allchecked != '' ? '' : 'none';
	$('.docompare').each(
		function()
		{
			$(this).css('display', display);
		}
	);
}

function chkForm()
{
	if ($('#CompareID').val() == '')
	{
		alert('יש לסמן מוצרים להשוואה');
		return false;
	}
	return true;
}

function goToFocus(sToId)
{
	setTimeout('Itemcat'+sToId+'.focus();', 3000);
}
	

//-----------------------------------------------------------------------------		
//	show alert on right click
//-----------------------------------------------------------------------------		
var message;
message = "                         כל הזכויות שמורות\n";
message = message + "     ,אין לשכפל, להעתיק או להפיץ מלל כלשהו\n";
message = message + "    סימני מסחר, קוד מחשב ותמונות ללא הסכמה\n";
message = message + ".מפורשת בכתב של בעלי האתר. העבריין יתבע לדין";
///////////////////////////////////
function clickIE4(){
	if (event.button==2){
		alert(message);
		return false;
	}
}

function clickNS4(e){
	if (document.layers||document.getElementById&&!document.all){
		if (e.which==2||e.which==3){
			alert(message);
			return false;
		}
	}
}

if (document.layers){
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
	document.onmousedown=clickIE4;
}
//else {
//	document.oncontextmenu=new Function("alert(message);return false");
//}

