var comImg = "../../comn/img";
var arabicImg  = comImg+"/arabic";
var englishImg = comImg+"/english";

function openWin(url,title,param,cx,cy)
{	
	var wind = null
	var xpos = (window.screen.width - cx)/2;
	var ypos = (window.screen.height - cy)/2;
	param += ",top=" + ypos + ",left=" + xpos + ",width=" + cx + ",height=" + cy;
	wind = open(url,title,param,true);
	wind.focus();
	
}
function ChangeLang(lang)
{
	var re
	if (lang=="arabic")
		re = /english/g;             
	else
		re = /arabic/g;             
	document.location.href = document.location.href.replace(re,lang);
}

function SetCookie(sName, sValue)
{
  date = new Date();
  document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 2010 23:59:59 GMT;";
}

function GetCookie(sName)
{
  // cookies are separated by semicolons
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
     var aCrumb = aCookie[i].split("=");
     
    if (sName == aCrumb[0]) 
		  return unescape(aCrumb[1]);
  }
	
  // a cookie with the requested name does not exist
  return null;
}

if(document.location.href.indexOf("english")!=-1)
	SetCookie("lang","english")
else
	SetCookie("lang","arabic")	
