﻿if (document.images) {
			imgU = new Image();
			imgU.src = "/images/default_arrow_down.gif";
			imgD = new Image();
			imgD.src = "/images/default_arrow.gif";
        }
                
		
		function showLayer(layerName,imagename) {
			if (document.getElementById(layerName).style.display == "none"){
				document.getElementById(layerName).style.display = "";
				document.getElementById(imagename).src = eval("imgU.src");
			}else{
				if (document.getElementById(layerName).style.display == "")
				{
				document.getElementById(layerName).style.display = "none";
				document.getElementById(imagename).src = eval("imgD.src");
				}
			}
		} 

function openwin(nameofapp , width , height)
{
                var halfwidth = width/2;
                var halfheight = height/2;
                 var pWidth = ( ((parseInt(screen.width) / 2)) - halfwidth)
                var pHeight = (((parseInt(screen.height) / 2)) - halfheight)
                aWindow = window.open(nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=" + width + ",height=" + height + ",top=" + pHeight + ",left=" + pWidth + ",scrollbars=0,resizable=yes");
}
function openwinscroll(nameofapp , width , height)
{
                var halfwidth = width/2;
                var halfheight = height/2;
                 var pWidth = ( ((parseInt(screen.width) / 2)) - halfwidth)
                var pHeight = (((parseInt(screen.height) / 2)) - halfheight)
                aWindow = window.open(nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=" + width + ",height=" + height + ",top=" + pHeight + ",left=" + pWidth + ",scrollbars=yes,resizable=yes");
}
	/*function dothesubmit(x)
				{
				//alert("hello");
				//var x = document.getElementById("txtSearch").value;//"<%= txtSearch.ClientID %>").value;
				//alert(x);
				 if ((x.indexOf("'")>-1) || (x.indexOf("<")>-1))
				 {
					alert("<%=  Resources.CommonResources.SearchInvalid %>");
					return false;
				 }
				
				else
				{
				if (x !="")
				{
		            document.location.href='/arabic/Search.htm?SearchKeyword='+x;
				}
				else
				{
				    alert ("<%= Resources.CommonResources.SearchWordReq %>");
				    return false;
				}				
				}
				}
				*/
	 function dothesubmitenter(evt,buttonToClick)
					{
					
						if(window.event)
						{
							key=evt.keyCode;
						}
						else
						{
							key=evt.which;
						}
						if(key==13)
						{
							if(window.event)
							{
								window.event.keyCode.returnValue=false;
								window.event.keyCode=true;
							}
							else
							{
								return false;
							}
							try
							{
						
					
							document.getElementById(buttonToClick ).click();
							}
							catch (e)
							{
							    alert(e.toString());
					            return false;
							}
							
							return true;
							
							
						}
						return false;
                }