
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function map_DoFSCommand(command, args) {
	var mapObj = isInternetExplorer ? document.all.map : document.map;
	//
	// Place your code here.
	//
	//Page_IsValid = true;
	//Page_BlockSubmit = false;
	document.getElementById("farmId").value = "farms/" + command;
	//document.Form1.onsubmit = null;
	//document.Form1.language = "";
	
	document.Form1.submit();
	 //if (command == "Ron")
	  // document.location = "http://localhost/IJM/index.aspx?hava=ron";
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub map_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call map_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function checkPhotos(source, arguments)
{
var imagePath = source.parentNode.parentNode.previousSibling.firstChild.nextSibling.nextSibling.firstChild.value;//firstChild.nextSibling.value;
//alert(imagePath);
	if( imagePath != "" )
	{
	
	var pathLength = imagePath.length;
	var lastDot = imagePath.lastIndexOf(".");
	var fileType = imagePath.substring(lastDot,pathLength);

		if( (fileType == ".gif")   ||
			(fileType == ".jpg")   ||
			(fileType == ".jpeg")  ||
			(fileType == ".GIF")   ||
			(fileType == ".JPG")   ||
			(fileType == ".JPEG")
		)
		{
		//alert(fileType);
			arguments.IsValid = true;
				return true;
		} 
		else
		{
			arguments.IsValid = false;
			return false;
			//alert('<%=Labels.Get("pictureExtErrorMsg")%>');
		}
	}
}

function checkEmail(source, arguments)
 {
 
 var x = source.previousSibling;//document.getElementById("email");

 //source.previousSibling.id);
	if( x.value != ""){
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.value)){
		
			arguments.IsValid = true;
			return true;
		}
		
		arguments.IsValid = false;
		return false;
	}
	//alert("Invalid E-mail Address! Please re-enter.")
	arguments.IsValid = false;
	return false;
}

function checkEmail4(email)
 { 
 //alert(email);
 	if( email != ""){
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){		
//alert(1);			
			return true;
		}
	}
	
	return false;
}

function checkCategoryNum(source, arguments)
{
	var selectElm = document.getElementById("cat");	
	var num = getSelectedNum(selectElm.options);
	//alert(num);
	
 	if( num > 0 && num <= 3)
	{
		arguments.IsValid = true;
		return true;
	}
	
	arguments.IsValid = false;
	return false;
}

function getSelectedNum(options)
{
	var num = 0;
	for(var i=0;i<options.length;i++)
	{
		if(options[i].selected)
			num++;
	}
	
	return num;
}

function checkCategory(source, arguments)
{
//alert("f");
 	if( getOptionSelectedVal("cat") > 0 )
	{
		arguments.IsValid = true;
		return true;
	}
	
	arguments.IsValid = false;
	return false;
}

function checkLocation(source, arguments)
{
//alert("f1");
 	if(getOptionSelectedVal("location") > 0 )
	{
		arguments.IsValid = true;
		return true;
	}
	
	arguments.IsValid = false;
	return false;
}

function checkNameLength(source, arguments)
{
//alert("f1");
var name = source.previousSibling.value;
//alert("name " + name.length);
 	if(name.length <= 16)
	{
		arguments.IsValid = true;
		return true;
	}
	
	arguments.IsValid = false;
	return false;
}


function checkDescriptionLength(source, arguments)
{
//alert(source);
//alert(source.parentNode.parentNode.id);
var name = source.parentNode.parentNode.previousSibling.childNodes[6].firstChild.value;
//var name = document.all("imageDesc").value;
//alert("name " + name.length);
 	if(name.length <= 60)
	{
		arguments.IsValid = true;
		return true;
	}
	
	arguments.IsValid = false;
	return false;
}

function IsPriceNumeric(source, arguments) {
   var sText = source.parentNode.parentNode.previousSibling.childNodes[4].firstChild.value;
   /*
   var ValidChars = "0123456789."; 
   var Char;
   for (i = 0; i < sText.length; i++) {
       Char = sText.charAt(i);
       if (ValidChars.indexOf(Char) == -1) {
		  arguments.IsValid = false;
          return false;
       }
    }
        
    arguments.IsValid = true;
    return true;
    */
    if( sText.length > 0 )
    {
		arguments.IsValid = true;
		return true;
    }
    else
    {
		arguments.IsValid = false;
        return false;
    }
}

function checkEmail11(source, arguments)
 {
 
 var x = source.parentNode.previousSibling.firstChild;//document.getElementById("email");

 //source.previousSibling.id);
	if( x.value != ""){
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(x.value)){
		
			arguments.IsValid = true;
			return true;
		}
		
		arguments.IsValid = false;
	}
	//alert("Invalid E-mail Address! Please re-enter.")
	arguments.IsValid = false;
	return false;
}


function IsNumeric(sText) { 
   var ValidChars = "0123456789."; 
   var Char;
   for (i = 0; i < sText.length; i++) {
       Char = sText.charAt(i);
       if (ValidChars.indexOf(Char) == -1) {
          return false;
       }
    }
   return true;
}



function checkEmail1(source, arguments)
 {
 //alert("gf");
	if(document.MailForm.mailReciever.value != ""){
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.MailForm.mailReciever.value)){
			arguments.IsValid = true;
			return true;
		}
		alert("Invalid E-mail Address! Please re-enter.")
		arguments.IsValid = false;
	}
	arguments.IsValid = false;
	return false;
}

function checkEmail2(source, arguments)
 {
 //alert("gf");
	if(document.MailForm.senderMail.value != ""){
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.MailForm.senderMail.value)){
			arguments.IsValid = true;
			return true;
		}
		alert("Invalid E-mail Address! Please re-enter.")
		arguments.IsValid = false;
	}
	arguments.IsValid = false;
	return false;
}
function checkMail123()
{
	var x = document.forms[0].email.value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) alert('YES! Correct email address');
	else alert('NO! Incorrect email address');
}

function IsEnter()
{
// alert(document.all("nameTB").value);
  if(window.event && window.event.keyCode == 13)
  {
	window.event.cancelBubble = true;
	window.event.returnValue = false;
  }
}
function IsEnter111(validate,id)
{
// alert(document.all("nameTB").value);
  if(window.event && window.event.keyCode == 13)
  {
	window.event.cancelBubble = true;
	window.event.returnValue = false;
	var button = document.getElementById(id).firstChild;
	//alert(button);
	if( validate )
		if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate();
	button.click();
	//if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate();
	//__doPostBack('MainViewCtr1$ctl0$ctl0$LoginViewCtr1$submitBut','');
  }
}


function getOptionSelectedVal(selectId)
{

	var selectElm = document.getElementById(selectId);
	//alert("select " + selectElm.value);
	return selectElm.selectedIndex;
}

function launch_spyWin() 
{
    spyWin = window.open('/ijm/Guard.aspx','spyWin',
       'width=100,height=100,left=2000,top=0,status=0');
    spyWin.blur();
}

function countClick(id) 
{
	var button = document.getElementById("transformImg");
	//var temp = button.src;
	//button.src = "/ijm/mailCounter.aspx?id=" + id + "&rnd=" + Math.random();
	//button.src = temp;
	//alert(button.src);
}

function showLargeImage(obj,id)
{
  var imgSrc = obj.src;  
  var imgName = imgSrc.substring(imgSrc.lastIndexOf("/")+1,imgSrc.length);
  var imgPath = imgSrc.substring(0,imgSrc.lastIndexOf("/")+1);
  var bigImage = imgPath + "big/" + imgName;
  //var button = document.getElementById("transformImg");
  //button.src = "/ijm/showImage.aspx?id=" + id + "&name=" + imgName + "&rnd=" + Math.random();
  window.open("/ijm/showImage.aspx?id=" + id + "&name=" + imgName + "&rnd=" + Math.random(), "big",""); 
}

function showLargeGiftImage(obj,id)
{
  var imgSrc = obj.src;  
  var imgName = imgSrc.substring(imgSrc.lastIndexOf("/")+1,imgSrc.length);
  var imgPath = imgSrc.substring(0,imgSrc.lastIndexOf("/")+1);
  var bigImage = imgPath + "big/" + imgName;
  //var button = document.getElementById("transformImg");
  //button.src = "/ijm/showImage.aspx?id=" + id + "&name=" + imgName + "&rnd=" + Math.random();
  window.open(bigImage, "big",""); 
}

function checkAgree(source, arguments)
{
 //alert("gf");
 var tdElm = document.getElementById("agreeTd");
 
 var x = tdElm.firstChild.firstChild;
 arguments.IsValid = x.checked; 
}


function setLocation(id)
{	
	document.location = "/ijm/creator.aspx?id=" + id + "&x=" + document.all(scrollX).value + "&y=" + document.all(scrollY).value;
}
//var prevCreator;


function SendTemplateForm1(enableChecking)
{
	var dontSend = false;
	var formTbl = document.getElementById("formTbl");
	var inputTags = formTbl.getElementsByTagName("input");
	
	var params = "submitForm;";
	
	for (var i = 0; i < inputTags.length; i++)
	{
		var id = inputTags[i].attributes.getNamedItem("id");
		var type = inputTags[i].attributes.getNamedItem("type");		
		var errorMsg = inputTags[i].attributes.getNamedItem("em");	

		if( enableChecking )
		{
			if( type.value == "text" )
			{
				// change 20.3.2008
				var value = inputTags[i].value.replace(","," ").replace("'"," ");			
				//alert(inputTags[i].parentNode.nextSibling.firstChild);
				
				if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
				{
				    var msg = inputTags[i].parentNode.nextSibling.nextSibling;
				    //alert(msg.tagName);	
				}
				else
				{
				    var msg = inputTags[i].parentNode.nextSibling;
				}
			

				if( value == "" &&  errorMsg != null  )
				{													
					msg.className = "showElm2";
					dontSend = true;
				}
				else if( value != "" &&  errorMsg != null  )
				{	
				// change 20.3.2008
				/*		
					if(id.value == "emailTB")
					{
						if(checkEmail4(value))
						{							
							msg.className = "hideElm1";
						}
						else
						{							
							msg.className = "showElm2";
							dontSend = true;
						}
					}
					else
					{						
						msg.className = "hideElm1";						
					}					
				*/
				// change 20.3.2008
				if(msg != null)
				    msg.className = "hideElm1";
				}
				
				params = params + id.value + "=" + value + ";";
			}
			else if( type.value == "checkbox" )
			{
				var checked = inputTags[i].checked;
				

					if( !checked &&  errorMsg != null  )
					{							
						dontSend = true;
					}
				
								
				params = params + id.value + "=" + checked + ";";
			}		
			
		}
		
		
	}
	
	var textAreaTags = formTbl.getElementsByTagName("textarea");
	
	for (var i = 0; i < textAreaTags.length; i++)
	{
		var id = textAreaTags[i].attributes.getNamedItem("id");		
		
		
		var value = textAreaTags[i].value;
		
		params = params + id.value + "=" + value + ";";
	}

	//alert(params);
	
	if( !dontSend )
	{
	    var errorFormMsg = document.getElementById("errorFormMsg");
	    errorFormMsg.className = "hideElm1";

		SetStatus(lang);	
		Comm.SetPage1('registerFarm', params ,applySetPage);
	}	
	else{
	    var errorFormMsg = document.getElementById("errorFormMsg");
	    errorFormMsg.className = "showElm3";
	    }

}

function SendTemplateForm(enableChecking)
{
//alert(1);
	var dontSend = false;
	var dontSend1 = false;
	var formTbl = document.getElementById("formTbl");
	var inputTags = formTbl.getElementsByTagName("input");
	
	
	var params = "submitForm;";
	
	for (var i = 0; i < inputTags.length; i++)
	{
		var id = inputTags[i].attributes.getNamedItem("Id");		
		var errorMsg = inputTags[i].attributes.getNamedItem("em");
		var type = inputTags[i].attributes.getNamedItem("type");
		
		
		if( enableChecking )
		{
			if( type.value == "text" )
			{
				// change 20.3.2008
				var value = inputTags[i].value.replace(","," ").replace("'"," ");			
				//alert(inputTags[i].parentNode.nextSibling.firstChild);
				
				if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))
				{
				    var msg = inputTags[i].parentNode.nextSibling.nextSibling;
				    //alert(msg.tagName);	
				}
				else
				{
				    var msg = inputTags[i].parentNode.nextSibling;
				}
			

				if( value == "" &&  errorMsg != null  )
				{													
					msg.className = "showElm2";
					dontSend = true;
				}
				else if( value != "" &&  errorMsg != null  )
				{	
				// change 20.3.2008
				/*		
					if(id.value == "emailTB")
					{
						if(checkEmail4(value))
						{							
							msg.className = "hideElm1";
						}
						else
						{							
							msg.className = "showElm2";
							dontSend = true;
						}
					}
					else
					{						
						msg.className = "hideElm1";						
					}					
				*/
				// change 20.3.2008
				if(msg != null)
				    msg.className = "hideElm1";
				}
				
				params = params + id.value + "=" + value + ";";
			}
			else if( type.value == "checkbox" )
			{
				var checked = inputTags[i].checked;
				

					if( !checked &&  errorMsg != null  )
					{							
						dontSend1 = true;
					}
				
								
				params = params + id.value + "=" + checked + ";";
			}		
			
		}
		
		
	}
	
	//alert(params);
	
	if( dontSend ){
	    var errorFormMsg = document.getElementById("errorFormMsg");
	    errorFormMsg.className = "showElm3";
	    }
    else if( dontSend1 ){
        var errorFormMsg = document.getElementById("errorFormMsg");
	    errorFormMsg.className = "hideElm1";
	    var errorFormMsg1 = document.getElementById("errorFormMsg1");
	    errorFormMsg1.className = "showElm3";
	    }	    
	else
	{
	    var experience = document.getElementById("experience");
	    //alert(experience.value);
	    var experienceValue = experience.value.replace(","," ").replace("'"," ");	
	    params = params + "experience=" + experienceValue + ";";
	    
	    var errorFormMsg = document.getElementById("errorFormMsg");
	    errorFormMsg.className = "hideElm1";
	    var errorFormMsg1 = document.getElementById("errorFormMsg1");
	    errorFormMsg1.className = "hideElm1";

		SetStatus(lang);	
		Comm.SetPage1('register', params ,applySetPage);
	}

}



function SendFPForm(enableChecking)
{
	var dontSend = false;	
	var mail = document.getElementById("txtEmail");

	if( enableChecking )
	{
		if( mail.value == "" )
		{				
			var mailIdMsg = document.getElementById("emailMsg");
			mailIdMsg.className = "showElm2";
			dontSend = true;
		}
		else if( mail.value != "" )
		{			
			var mailIdMsg = document.getElementById("emailMsg");			
			
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail.value))
			{	
				mailIdMsg.className = "hideElm1";
			}
			else
			{
				
				mailIdMsg.className = "showElm2";
				dontSend = true;	
			}	
		}		
	}
	
	var params = "submitForm;" + mail.value;
	
	if( !dontSend )
	{
		SetStatus(lang);	
		Comm.ForgotPass(params ,applyFP);
	}
}

function SendLoginForm(enableChecking)
{
	var dontSend = false;
	var memberId = document.getElementById("txtMemberId");
	var mail = document.getElementById("txtEmail");

	if( enableChecking )
	{
		if( memberId.value == "" )
		{				
			var memberIdMsg = document.getElementById("txtMemberIdMsg");
			memberIdMsg.className = "showElm2";
			dontSend = true;
		}
		else if( memberId.value != "" )
		{			
			var memberIdMsg = document.getElementById("txtMemberIdMsg");
			memberIdMsg.className = "hideElm1";
		}
		
		if( mail.value == "" )
		{				
			var mailIdMsg = document.getElementById("emailMsg");
			mailIdMsg.className = "showElm2";
			dontSend = true;
		}
		else if( mail.value != "" )
		{			
			var mailIdMsg = document.getElementById("emailMsg");			
			
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail.value))
			{	
				mailIdMsg.className = "hideElm1";
			}
			else
			{
				
				mailIdMsg.className = "showElm2";
				dontSend = true;	
			}	
		}		
	}
	
	var params = "submitForm;" + mail.value + ";" + memberId.value;
	
	if( !dontSend )
	{
		SetStatus(lang);	
		Comm.Login(params ,applyLogin);
	}
}

function SendIsMemberForm(enableChecking)
{
	var dontSend = false;
	var key = document.getElementById("txtPass");
	var mail = document.getElementById("txtEmail");

	if( enableChecking )
	{
		if( key.value == "" )
		{				
			var txtPassMsg = document.getElementById("txtPassMsg");
			txtPassMsg.className = "showElm2";
			dontSend = true;
		}
		else if( key.value != "" )
		{			
			var txtPassMsg = document.getElementById("txtPassMsg");
			txtPassMsg.className = "hideElm1";
		}
		
		if( mail.value == "" )
		{				
			var mailIdMsg = document.getElementById("emailMsg");
			mailIdMsg.className = "showElm2";
			dontSend = true;
		}
		else if( mail.value != "" )
		{			
			var mailIdMsg = document.getElementById("emailMsg");			
			
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail.value))
			{	
				mailIdMsg.className = "hideElm1";
			}
			else
			{
				
				mailIdMsg.className = "showElm2";
				dontSend = true;	
			}	
		}		
	}
	
	var params = "submitForm;" + mail.value + ";" + key.value;
	
	if( !dontSend )
	{
		SetStatus(lang);	
		Comm.IsMember(params ,applyIsMember);
	}
}

function SendContactForm(enableChecking)
{
	var name = document.getElementById("nameTB");
	var mail = document.getElementById("mailTB");
	var subject = document.getElementById("subjectTB");
	var remark = document.getElementById("remarkTB");
	var nameLabel = document.getElementById("nameErrorLabel");
	var mailLabel = document.getElementById("mailErrorLabel");

	if( enableChecking )
	{	
		if( name.value == "" )
		{		
			nameLabel.className = "showElm2";
			return;
		}
		else
		{
			nameLabel.className = "hideElm1";
		}
		
		if( mail.valuee != "")
		{
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(mail.value))
			{	
				mailLabel.className = "hideElm1";
			}
			else
			{
				
				mailLabel.className = "showElm2";
				return;		
			}	
		}
		else
		{
			var mailLabel = document.getElementById("mailErrorLabel");
			mailLabel.className = "showElm2";
			return;		
		}	
	}	
	
	
	var params = "submitForm" + ";" + name.value + ";" + mail.value + ";" + subject.value + ";" + remark.value;
	
	SetStatus(lang);	
	Comm.SetPage1('contact', params ,applySetPage);
}

function SetPage(location,lang)
{		
	
	SetStatus(lang);	
	//alert("f");
	Comm.SetPage(location, lang, applySetPage);
}

function Signout()
{		
	
	SetStatus(lang);	
	var loginMemberTD = document.getElementById("loginMemberTD");
    loginMemberTD.className = "hideElm2";

	//alert("f");
	Comm.Signout(applySetPage);
}

function SetLang(type)
{	
	SetStatus(type);	
	Comm.SetLang(type,applySetLang);
}

function SetStatus(type)
{
	var lbl = document.getElementById("loadLabel");
	
	if( type == "he" )
		lbl.innerHTML = "&nbsp;" + loadingHe + "&nbsp;";
	else
		lbl.innerHTML = "&nbsp;" + loadingEn + "&nbsp;";
		
	lbl.className = "showElm1";
}

function GetPageName()
{
	var location = String(window.location);			
	var slashPos = location.lastIndexOf("/");
	var dotPos = location.lastIndexOf(".");
	return location.substring(slashPos+1,location.length-5);	
}

function applySetPage(response)
{
	if(response.error == null)
	{			
		//alert(response.value);
		var result = response.value.split("###");
		document.title = result[0];
		document.getElementById("loadLabel").className = "hideElm1";		
		document.getElementById("mainViewTd").innerHTML = result[1];
		//alert(result[2]);
		if( result[2] == "false" || result[2] == "undefind")
		{
			var loginMemberTD = document.getElementById("loginMemberTD");
		    loginMemberTD.className = "hideElm2";
        }
	}
	else
	{	
		var loginMemberTD = document.getElementById("loginMemberTD");
	    loginMemberTD.className = "hideElm2";

	    document.getElementById("loadLabel").className = "hideElm1";		
		document.getElementById("mainViewTd").innerHTML = "Internal Error, please refresh the page ( press F5 )";
	}
}

function applyFP(response)
{
	if(response.error == null)
	{			
		//alert(response.value);
		document.getElementById("loadLabel").className = "hideElm1";		
		var result = response.value.split("###");
		var action = result[0];
		
		if( action == "member" )
		{			
		//alert(result[1]);
			document.getElementById("mainViewTd").innerHTML = result[1];
		}
		else //if( action == "member" )
		{
			var msg = document.getElementById("lblMsg");
			msg.innerHTML = result[1];
		}		
	}
}

function applyLogin(response)
{
//alert(response.value);
	if(response.error == null)
	{			
		//alert(response.value);
		document.getElementById("loadLabel").className = "hideElm1";		
		var result = response.value.split("###");
		var action = result[0];
		//alert(result[1]);
		if( action == "member" )
		{
			//alert(result[2]);
			document.title = result[1];
			document.getElementById("mainViewTd").innerHTML = result[2];
			SetMenuDisplay(result[3]);
		}
		//else if( action == "wwind" )
		//{
		//	document.location = result[1];
		//}				
		else //if( action == "member" )
		{
			var msg = document.getElementById("lblMsg");
			msg.innerHTML = result[1];
		}		
	}
}

function applyIsMember(response)
{
	if(response.error == null)
	{			
		//alert(response.value);
		document.getElementById("loadLabel").className = "hideElm1";		
		var result = response.value.split("###");
		var action = result[0];
		

		var msg = document.getElementById("lblMsg");
		msg.innerHTML = result[1];
				
	}
}

function applySetLang(response)
{
	if(response.error == null)
	{					
		var result = response.value.split("###");		
		document.getElementById("loadLabel").className = "hideElm1";
		SetMenuDisplay(result[0]);		
		document.title = result[1];
		document.getElementById("mainViewTd").innerHTML = result[2];
		
		if( result[3] == "false" || result[3] == "undefind")
		{
			var loginMemberTD = document.getElementById("loginMemberTD");
		    loginMemberTD.className = "hideElm2";
        }
	}
	else
	{
		var loginMemberTD = document.getElementById("loginMemberTD");
	    loginMemberTD.className = "hideElm2";

	    document.getElementById("loadLabel").className = "hideElm1";		
		document.getElementById("mainViewTd").innerHTML = "Internal Error, please refresh the page ( press F5 )";

    }
	
}


function SetMenuDisplay(menuStr)
{
//alert(menuStr);
		var menuItems = menuStr.split(";");

		var lang = menuItems[0];
		var date = menuItems[1];
		//var dateElm = document.all("date");
		//dateElm.innerText = date;
		
		var align = menuItems[2];

		var tr = document.getElementById("items");
		
		var table = document.getElementById("tableItems");
		table.dir = menuItems[3];

		var memberLoginTbl = document.getElementById("memberLoginTbl");
		memberLoginTbl.dir = menuItems[3];

		var loginMemberTD = document.getElementById("loginMemberTD");
		loginMemberTD.className = menuItems[4];

		var loginMemberName = document.getElementById("loginMemberName");
		loginMemberName.innerHTML = menuItems[5];

		var hello = document.getElementById("hello");
		hello.innerHTML = menuItems[6];

		var signout = document.getElementById("signout");
		signout.innerHTML = menuItems[7];
		
		var children = tr.childNodes;
		var items = menuItems[8].split(",");
		//alert(items);
		var itemNum = 0;
		
		for (var i = 0; i < children.length; i++) 
		{
		/*
			var mod = i%2;
			
			if( i != 0 && mod != 0)
			{
				continue;
			}		
		*/	
			if( children[i].tagName == null || children[i].tagName.toUpperCase() != "TD" || children[i].firstChild.tagName.toUpperCase() != "A")
			{
				continue;
			}		

			var itemElments = items[itemNum].split(":");
			
			if( i == 0 )
			{
				children[i].align = align;
			}
			//alert(itemElments[2]);
			children[i].width = itemElments[3];
			
			
			children[i].firstChild.href = "javascript:SetPage('" + itemElments[0] + "','" + lang + "');";
			children[i].firstChild.target = itemElments[1];
			children[i].firstChild.innerHTML = itemElments[2];
			itemNum++;
		}
}
//onunload = launch_spyWin;

/*
   function isEmail(source, arguments)
   {
	string strRegex = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";   
	var result = strRegex.exec(document.all("mailTB").value);
      if (result)
         arguments.IsValid=true;
      else
         arguments.IsValid=false;
   }


function setSelectElm(selectId,optionId)
{
	var selectElm = document.getElementById(selectId);
	selectElm.options[optionId].selected = true;
}
*/