rekaArray=new Array();

function doOver2(element, runtimeS, prop1)
{
    switch (element.className) 
    { 
       case "td13b" : 
            runtimeS.borderColor = '#FF9000';
            break; 
       case "tdOut" :
            document.all[prop1].runtimeStyle.borderTopColor = '#666699';
            //element.document.all[prop1].runtimeStyle.borderBottomColor = '#666699';
            document.all[prop1].runtimeStyle.backgroundColor = '#ff9900';
            document.all[prop1 + "sub"].runtimeStyle.display = 'block';
            break; 
       
    }   
}

function doOut2(element, runtimeS, prop1)
{
    switch (element.className) 
    { 
       case "td13b" : 
            runtimeS.borderColor = '#55558D';
            break; 
    } 
}

function doLeave2(element, runtimeS, prop1)
{
    switch (element.className) 
    { 
       case "td13b" : 
            runtimeS.borderColor = '#55558D';
            break; 
       case "tdOut" : 
            document.all[prop1].runtimeStyle.borderTopColor = '#b1bec9';
            //element.document.all[prop1].runtimeStyle.borderBottomColor = '#b1bec9';
            document.all[prop1].runtimeStyle.backgroundColor = '';
            document.all[prop1 + "sub"].runtimeStyle.display = 'none';
            break; 
    }    
}

function doClick2(element, runtimeS, prop1, prop2)
{    
    switch (element.className) 
    { 
       case "tdw" :
            getWL('' + prop1 + '', '' + prop2 + '', '_blank');
            break;
    } 
}

function  getWL(uk, uNum, tar)
{
    var xmlHttp;
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlHttp)
    {
	    xmlHttp.open("GET","urlGive.aspx?uk=" + uk + "&uNum=" + uNum, false);
	    xmlHttp.send();
	    xmlHttp.close;
	    
	    if (xmlHttp.responseText != "no")
        {
            doLw(xmlHttp.responseText, tar)
        }
    }
}

function doLw(WU,theTarget)
{
	linkUwL.href = WU;
	linkUwL.target=theTarget;
	linkUwL.click();
}

function doResize()
{
	mainWidth = parseInt((document.body.clientWidth/100)*90);
	if(mainWidth <= 776){mainWidth=776;} 
	startPoint = (document.body.clientWidth/2)-(mainWidth/2);
	
	document.all.a.style.width = mainWidth;
	document.all.a.style.pixelLeft = startPoint;
	document.all.a.style.pixelTop = 0;
	
	document.all.sendFriend1.style.pixelLeft = startPoint+250;
    document.all.sendFriend1.style.pixelTop = 100;
	
    document.all.sendFriend2.style.pixelLeft = startPoint+300;
    document.all.sendFriend2.style.pixelTop = 105;
}

function doFlashReka()
{
    for(i=0; i<=rekaArray.length-1; i++)
    {   
        document.getElementById("" + rekaArray[i][0] + "3").innerHTML = "";
        document.all(rekaArray[i][0]+"1").style.display = "block";
        lineW = parseInt(rekaArray[i][6]);
        theHeight = parseInt(document.getElementById(""+rekaArray[i][0]+"").offsetHeight);
        theWidth = parseInt(document.getElementById(""+rekaArray[i][0]+"").offsetWidth);  
        strHtml = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width='" + (theWidth+lineW) + "' height='" + (theHeight+lineW) + "' id='" + rekaArray[i][0] + "F'>";
        strHtml += "<param name='movie' value='myFlash/roundBack.swf?theW=" + (theWidth-lineW) + "&theH=" + (theHeight-lineW) + "&lineC=" + rekaArray[i][1] + "&rekaC=" + rekaArray[i][2] + "&tran=" + rekaArray[i][3] + "&tranL=" + rekaArray[i][4] + "&round=" + rekaArray[i][5] + "&lineW=" + rekaArray[i][6] + "' />";
        strHtml += "<param name='scale' value='noscale' />";
        strHtml += "<param name='salign' value='lt' />";
        strHtml += "<param name='wmode' value='transparent' />";
        strHtml += "</object>";
        document.getElementById("" + rekaArray[i][0] + "3").innerHTML = "" + strHtml + "";
    }
}
function flashReka(tdid, width, height, theSWF)
{
  document.getElementById(tdid).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width=" + width + " height=" + height + ">"+
  "<param name=movie value='" + theSWF + "' />"+
  "<param name='scale' value='noscale' />"+
  "<param name='salign' value='lt' />"+
  "<param name=wmode value=transparent />"+
  "</object>";
}

function doFlashReka2(tdid, width, height, theSWF)
{    
  document.getElementById(tdid).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width=" + width + " height=" + height + ">"+
  "<param name=movie value='" + theSWF + "' />"+
  "<param name='scale' value='noscale' />"+
  "<param name='salign' value='lt' />"+
  "<param name=wmode value=transparent />"+
  "</object>";
}

function doFlash(tdid, width, height, theSWF)
{
  document.getElementById(tdid).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width=" + width + " height=" + height + ">"+
  "<param name=movie value='" + theSWF + "' />"+
  "<param name=wmode value=transparent />"+
  "</object>";
}

function doFlash2(tdid, width, height, theSWF, SWFid)
{
  document.getElementById(tdid).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' id=" + SWFid + " width=" + width + " height=" + height + ">"+
  "<param name=movie value='" + theSWF + "' />"+
  "<param name=wmode value=transparent />"+
  "</object>";
}

function doFlash3(tdid, width, height, theSWF)
{
  document.getElementById(tdid).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width=" + width + " height=" + height + ">"+
  "<param name=movie value='" + theSWF + "' />"+
  "<param name=quality value=high />"+
  "<param name=scale value=noscale />"+
  "<param name=wmode value=transparent />"+
  "</object>";
}

function doFlash4(tdid, width, height, theSWF)
{
  document.getElementById(tdid).innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' width=" + width + " height=" + height + ">"+
  "<param name=movie value='" + theSWF + "' />"+
  "</object>";
}

function showDiv1(DivId)
{
	DivId.style.display = "Block";
}
function showDiv2(DivId)
{
	DivId.style.display = "none";
}
function openWin(theURL,winName,features)
{
	NW = window.open(theURL,winName,features);
	NW.blur();
	NW.focus();
}
function checkAllNum(theForm,theInput,theDiv,doReka)
{
	if(isNaN(document.all(""+theForm+"")(""+theInput+"").value)&&spaceCheck(document.all(""+theForm+"")(""+theInput+"").value)!=true)
	{	
		document.all(""+theForm+"")(""+theInput+"").value="";
		document.all(""+theDiv+"").innerHTML="<strong>הכנס ערך מספרי</strong>";
		document.all(""+theForm+"")(""+theInput+"").focus();
		if(doReka=="yes"){doFlashReka();}
		return false;
	}
	else if(spaceCheck(document.all(""+theForm+"")(""+theInput+"").value)==true)
	{
		document.all(""+theForm+"")(""+theInput+"").value="";
		document.all(""+theDiv+"").innerHTML="<strong>הכנס ערך מספרי</strong>";
		document.all(""+theForm+"")(""+theInput+"").focus();
		if(doReka=="yes"){doFlashReka();}
		return false;
	}
	else
	{
	    document.all(""+theDiv+"").innerHTML="";
	    if(doReka=="yes"){doFlashReka();}
		return true;
	}
	
	//else if(document.all(""+theForm+"")(""+theInput+"").value==0)
	//{
		//document.all(""+theForm+"")(""+theInput+"").value="";
		//document.all(""+theDiv+"").innerHTML="<strong>הכנס ערך מספרי</strong>";
		//document.all(""+theForm+"")(""+theInput+"").focus();
		//return false;
	//}
}
function spaceCheck(theStr)
{
	str = theStr;
	strarray = str.split(" ");
	if(str.length==strarray.length-1){return theStr=true;}
}
function emailCheck(Email)
{
	if (Email.length >0)
	{
		var i   = Email.indexOf("@")
		var j   = Email.indexOf(".",i)
		var k   = Email.indexOf(",")
		var kk  = Email.indexOf(" ")
		var aa  = Email.indexOf("'")
		var jj  = Email.lastIndexOf(".") + 1
		var len = Email.length

		if ((i > 0) && (j > (i + 1)) && (k == -1) && (kk == -1) && (aa == -1) && (len - jj >= 2) && (len - jj <= 3)) 
		{
		 	return true;
		}
        else
		{
        	return false; 
		}	
	}
	else
	{
		 return false;
	}
}

var slicer1;
function makeValue(theForm,textLength,theCheck,urlPic)
{
	if (theForm.value.length > textLength)
	{
		document.all[theCheck].innerHTML="הטקסט ערוך מידי<img src="+urlPic+" width=16 height=15 border=0>";
		slicer1=theForm.value.slice(0,textLength-1)
		theForm.value = slicer1;
		theForm.focus();
		return false;
	}
	else
	{
		document.all[theCheck].innerHTML="";
	}
}

function doPics(picNum)
{
	document.all.TDbigPic.innerHTML = "<IMG SRC='http://www.tzimmer.com/"+arrayPicNames[picNum]+"' style='cursor: hand;' onclick='doMenu(3);' alt='לחצו לחזרה לגלריה'>";
	if(arrayPNlength > 2)
	{
	    if(picNum==(arrayPNlength-2))
	    {
		    document.all.TdnextSpacer.style.display = "block";
		    document.all.Tdnext.style.display = "none";
		    document.all.TdbackSpacer.style.display = "none";
		    document.all.Tdback.style.display = "block";
			
		    document.all.TdnextSpacer2.style.display = "block";
		    document.all.Tdnext2.style.display = "none";
		    document.all.TdbackSpacer2.style.display = "none";
		    document.all.Tdback2.style.display = "block";
			
		    document.all.TDnextText.innerHTML = "";
		    document.all.TDbackText.innerHTML = "<a id=linkBack href='javascript:onclick=doPics("+(picNum-1)+");' class=text7>לתמונה הקודמת</a>";
			
		    document.all.TDnextText2.innerHTML = "";
		    document.all.TDbackText2.innerHTML = "<a id=linkBack2 href='javascript:onclick=doPics("+(picNum-1)+");' class=text7>לתמונה הקודמת</a>";
	    }
	    else if(picNum==0)
	    {
		    document.all.TdnextSpacer.style.display = "none";
		    document.all.Tdnext.style.display = "block";
		    document.all.TdbackSpacer.style.display = "block";
		    document.all.Tdback.style.display = "none";
			
		    document.all.TdnextSpacer2.style.display = "none";
		    document.all.Tdnext2.style.display = "block";
		    document.all.TdbackSpacer2.style.display = "block";
		    document.all.Tdback2.style.display = "none";
			
		    document.all.TDnextText.innerHTML = "<a id=linkNext href='javascript:onclick=doPics("+(picNum+1)+");' class=text7>לתמונה הבאה</a>";
		    document.all.TDbackText.innerHTML = "";
			
		    document.all.TDnextText2.innerHTML = "<a id=linkNext2 href='javascript:onclick=doPics("+(picNum+1)+");' class=text7>לתמונה הבאה</a>";
		    document.all.TDbackText2.innerHTML = "";
	    }
	    else
	    {
		    document.all.TdnextSpacer.style.display = "none";
		    document.all.Tdnext.style.display = "block";
		    document.all.TdbackSpacer.style.display = "none";
		    document.all.Tdback.style.display = "block";
			
		    document.all.TdnextSpacer2.style.display = "none";
		    document.all.Tdnext2.style.display = "block";
		    document.all.TdbackSpacer2.style.display = "none";
		    document.all.Tdback2.style.display = "block";
			
		    document.all.TDnextText.innerHTML = "<a id=linkNext href='javascript:onclick=doPics("+(picNum+1)+");' class=text7>לתמונה הבאה</a>";
		    document.all.TDbackText.innerHTML = "<a id=linkBack href='javascript:onclick=doPics("+(picNum-1)+");' class=text7>לתמונה הקודמת</a>";
			
		    document.all.TDnextText2.innerHTML = "<a id=linkNext2 href='javascript:onclick=doPics("+(picNum+1)+");' class=text7>לתמונה הבאה</a>";
		    document.all.TDbackText2.innerHTML = "<a id=linkBack2 href='javascript:onclick=doPics("+(picNum-1)+");' class=text7>לתמונה הקודמת</a>";
	    }
	}
	else
	{
	    document.all.TdnextSpacer.style.display = "none";
	    document.all.Tdnext.style.display = "none";
	    document.all.TdbackSpacer.style.display = "none";
	    document.all.Tdback.style.display = "none";
		
	    document.all.TdnextSpacer2.style.display = "none";
	    document.all.Tdnext2.style.display = "none";
	    document.all.TdbackSpacer2.style.display = "none";
	    document.all.Tdback2.style.display = "none";
	}
}

function closeSendF()
{
	document.all.sendFriend1.style.display = "none";
	document.all.sendFriend2.style.display = "none";
}

function openSendF()
{
	document.all.sendFriend1.style.display = "block";
	document.all.sendFriend2.style.display = "block";
	document.all.sendFreindTB1.style.display = "block";
	document.all.sendFreindTB2.style.display = "none";
}

function checkSendFreind(theForm) 
{
	var toSubmit;
	toSubmit=1;

	if (theForm.TEsenderName.value !=''&&spaceCheck(theForm.TEsenderName.value)!=true){document.all("TEsenderNameCheck").innerHTML="";}
	else{document.all("TEsenderNameCheck").innerHTML="אנא מלא שם<img src=images/alertErow.gif width=16 height=15 border=0>"; toSubmit=0;}
	
	if (theForm.TEfriendMail.value !=''&&emailCheck(theForm.TEfriendMail.value)==false){document.all("TEfriendMailCheck").innerHTML="כתובת הדואר האלקטרוני אינה טובה<img src=images/alertErow.gif width=16 height=15 border=0>"; toSubmit=0;}
	else if (theForm.TEfriendMail.value ==''){document.all("TEfriendMailCheck").innerHTML="אנא מלא דואר אלקטרוני של החבר<img src=images/alertErow.gif width=16 height=15 border=0>"; toSubmit=0;}
	else{document.all("TEfriendMailCheck").innerHTML="";}
	
	if (theForm.TEsenderMail.value !=''&&emailCheck(theForm.TEsenderMail.value)==false){document.all("TEsenderMailCheck").innerHTML="כתובת הדואר האלקטרוני אינה טובה<img src=images/alertErow.gif width=16 height=15 border=0>"; toSubmit=0;}
	else if (theForm.TEsenderMail.value ==''){document.all("TEsenderMailCheck").innerHTML="אנא מלא את הדואר האלקטרוני שלך<img src=images/alertErow.gif width=16 height=15 border=0>"; toSubmit=0;}
	else{document.all("TEsenderMailCheck").innerHTML="";}
	
	if (theForm.TEsenderText.value.length > 200){document.all("TEsenderTextCheck").innerHTML="הטקסט ערוך מידי<img src=images/alertErow.gif width=16 height=15 border=0>"; toSubmit=0;}
	
	if(toSubmit==1)
	{
		myString = new String(theForm.TEpageUrl.value)
		rExp = /&/gi;
		newPageUrl = myString.replace(rExp, "~~")
		
		document.all.sendFreindTD.innerHTML="<iframe id=sendFreindIF src='sendPageFreind.aspx?pu="+newPageUrl+"&sn="+theForm.TEsenderName.value+"&fm="+theForm.TEfriendMail.value+"&sm="+theForm.TEsenderMail.value+"&st="+theForm.TEsenderText.value+"' width='1' height='1' frameborder='0' scrolling='no'></iframe>";
	}
	else
	{
	    document.all.sendFRekaTA.style.height = "330";
	}
}

function checkSearchForm(theForm)
{
    var toSubmit;
    //toSubmit=1;
	
    if (theForm.headertageName_searchTE.value !=''&&spaceCheck(theForm.headertageName_searchTE.value)!=true){toSubmit=1;}
    else{toSubmit=0;}
	
    if(toSubmit==1){headertageName_linkSearch.click();}
}