function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


	function NewWindow(mypage, myname, w, h, scroll)
	{
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win = window.open(mypage, myname, winprops)
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
	
	function cb_Participate_Checked()
	{
		if (document.getElementById('Contactus1_cbParticipate').checked == true)
		{
			NewWindow('popDocument.aspx?ID=190&MID=36&SECID=-1&PID=36','name','400','150');						
		}
		return true;
	}
	function cb_Volunteer_Checked()
	{
		if (document.getElementById('Contactus1_cbVolunteer').checked == true)
		{
			NewWindow('popDocument.aspx?ID=192&MID=36&SECID=-1&PID=36','name','400','150');					
		}
		return true;
	}
	function cb_BecomeFriend_Checked()
	{
		if (document.getElementById('Contactus1_cbFriend').checked == true)
		{
			NewWindow('popDocument.aspx?ID=191&MID=36&SECID=-1&PID=36','name','400','175');					
		}
		return true;
	}
	
	function validateLogin()
		{
			var msg="";
			if (document.getElementById('Members1_txtLogin').value == "")
				msg +="- Username \n" 
			if (document.getElementById('Members1_txtPass').value == "")
				msg +="- Password \n" 
			if (msg!="")
			{
				msg="Please enter the following information:\n" + msg
				alert(msg);
				return false;
			}
			else
				return true; 
		}
		
function toggleBlock(d, i)
{
	var e = MM_findObj(d);
	if(i){
		var img = MM_findObj(i);
	}
	if (!e) return;
	if (e.style.display == "block"){
		e.style.display = "none";
		if(img != null) img.src = "images/icon_expand.gif";
	} else {
		e.style.display = "block";
		if(img != null) img.src = "images/icon_colapse.gif";
	}
}

function toggleBlockOff(d, i)
{
	var e = MM_findObj(d);
	if(i){
		var img = MM_findObj(i);
	}
	if (!e) return;
	if (e.style.display == "block"){
		e.style.display = "none";	
	} 
}

function toggleBlockOn(d, i)
{
	var e = MM_findObj(d);
	if(i){
		var img = MM_findObj(i);
	}
	if (!e) return;
	if (e.style.display == "none"){
		e.style.display = "block";	
	} 
}
	
function outdoor2()
{
	var w = 370;
    var h = 450;
    var left = screen.width/2 - w/2;
    var top = screen.height/2 - h/2;                                   
    window.open('BranchesMap.html','','width='+w+',height='+h+',left='+left+',top='+top)

}



function validateitPL(theForm)
		{
			var msg="";
			if (document.Form1.ddlLoanType.value == 0)
				msg +="- Loan Type\n" 
			if (document.Form1.ddlCurrency.value == 0)
				msg +="- Currency\n" 
			if (document.Form1.txtSalary.value == "")
				msg +="- Salary\n" 
			if (document.Form1.ddlRequestedYears.value == 0)
				msg +="- Requested Years\n"	
			if (document.Form1.txtRequestedAmount.value == "")
				msg +="- Loan Amount\n" 
			if (document.Form1.txtSalary.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtSalary.value) || !CheckNotLongInteger(document.Form1.txtSalary.value))
						msg +="- a valid salary\n"
				}
			if (document.Form1.txtRequestedAmount.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtRequestedAmount.value) || !CheckNotLongInteger(document.Form1.txtRequestedAmount.value) )
						msg +="- a valid amount\n"	
						
					else
						{
							if ((document.Form1.ddlLoanType.value == 1) && (document.Form1.ddlCurrency.value == 1))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,99000000))	
										msg +="- Max Amount = 99,000,000 LBP \n"
								}
							else if ((document.Form1.ddlLoanType.value == 2) && (document.Form1.ddlCurrency.value == 1))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,99000000))	
										msg +="- Max Amount = 99,000,000 LBP \n"
								}
							else if ((document.Form1.ddlLoanType.value == 3) && (document.Form1.ddlCurrency.value == 1))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,150000000))	
										msg +="- Max Amount = 150,000,000 LBP \n"
								}
							else if ((document.Form1.ddlLoanType.value == 1) && (document.Form1.ddlCurrency.value == 2))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,70000))	
										msg +="- Max Amount = 70,000 USD \n"
								}
							else if ((document.Form1.ddlLoanType.value == 2) && (document.Form1.ddlCurrency.value == 2))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,70000))	
										msg +="- Max Amount = 70,000 USD \n"
								}
							else if ((document.Form1.ddlLoanType.value == 3) && (document.Form1.ddlCurrency.value == 2))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,120000))	
										msg +="- Max Amount = 120,000 USD \n"
								}
						
						} 	
				}
				
			
			if (msg!="")
			{
				msg="Please enter the following information:\n" + msg
				alert(msg);
				return false;
			}
			else
				return true;
		}
		
/*---*/		
function validateitCL(theForm)
		{
			var msg="";
			if (document.Form1.ddlLoanType.value == 0)
				msg +="- Loan Type\n" 
			if (document.Form1.ddlCurrency.value == 0)
				msg +="- Currency\n" 
			if (document.Form1.txtSalary.value == "")
				msg +="- Salary\n" 
			if (document.Form1.ddlRequestedYears.value == 0)
				msg +="- Requested Years\n"
			if (document.Form1.txtRequestedAmount.value == "")
				msg +="- Loan Amount\n" 
			if (document.Form1.txtDownPaymentRatio.value == "")
				msg +="- Down Payment Amount\n" 
			if (document.Form1.txtSalary.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtSalary.value) || !CheckNotLongInteger(document.Form1.txtSalary.value))
						msg +="- a valid salary\n"
				}
			if (document.Form1.txtRequestedAmount.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtRequestedAmount.value) || !CheckNotLongInteger(document.Form1.txtRequestedAmount.value))
						msg +="- a valid amount\n"	
					else
						{
							if ((document.Form1.ddlLoanType.value == 1) && (document.Form1.ddlCurrency.value == 1))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value - document.Form1.txtDownPaymentRatio.value,0,70000))	
										msg +="- Max Amount = 70,000 USD \n"
								}
							else if ((document.Form1.ddlLoanType.value == 2) && (document.Form1.ddlCurrency.value == 1))
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value - document.Form1.txtDownPaymentRatio.value,0,40000))	
										msg +="- Max Amount = 40,000 USD \n"
								}
					}
				}
			if (document.Form1.txtDownPaymentRatio.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtDownPaymentRatio.value) || !CheckNotLongInteger(document.Form1.txtDownPaymentRatio.value))
						msg +="- a valid amount\n"
						
					else
					{
							if ((document.Form1.ddlLoanType.value == 1) && (document.Form1.ddlCurrency.value == 1))
								{
								if (!CheckBetween(eval(document.Form1.txtDownPaymentRatio.value / document.Form1.txtRequestedAmount.value * 100),20,100))	
										msg +="- You should pay at least 20% of the car's amount.\n"
								}
							else if ((document.Form1.ddlLoanType.value == 2) && (document.Form1.ddlCurrency.value == 1))
								{

								if (!CheckBetween(eval(document.Form1.txtDownPaymentRatio.value / document.Form1.txtRequestedAmount.value * 100),30,100))	
										msg +="- You should pay at least 30% of the car's amount.\n"
								}
					
					}	
				}
			
			
			if (msg!="")
			{
				msg="Please enter the following information:\n" + msg
				alert(msg);
				return false;
			}
			else
				return true;
}


/*---*/		
function validateitPB(theForm)
		{
			var msg="";
			if (document.Form1.ddlCurrency.value == 0)
				msg +="- Currency\n" 
			if (document.Form1.txtSalary.value == "")
				msg +="- Salary\n" 
			if (document.Form1.ddlRequestedYears.value == 0)
				msg +="- Requested Years\n"
			if (document.Form1.txtRequestedAmount.value == "")
				msg +="- Loan Amount\n" 
			if (document.Form1.txtSalary.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtSalary.value) || !CheckNotLongInteger(document.Form1.txtSalary.value))
						msg +="- a valid salary\n"
					else
					{
							if (document.Form1.ddlCurrency.value == 1)
								{
								if (document.Form1.txtSalary.value < 1200000)	
										msg +="- Salary must not be less than 1,200,000 LBP \n"
								}
							else if (document.Form1.ddlCurrency.value == 2)
								{
								if (document.Form1.txtSalary.value < 800)	
										msg +="- Salary must not be less than 800 USD \n"
								}			
					}	
				}
			if (document.Form1.txtRequestedAmount.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtRequestedAmount.value) || !CheckNotLongInteger(document.Form1.txtRequestedAmount.value))
						msg +="- a valid amount\n"	
					
					else
					{
							if (document.Form1.ddlCurrency.value == 1)
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,9000000))	
										msg +="- Max Amount = 9,000,000 LBP \n"
								}
							else if (document.Form1.ddlCurrency.value == 2)
								{
								if (!CheckBetween(document.Form1.txtRequestedAmount.value,0,6000))	
										msg +="- Max Amount = 6,000 USD \n"
								}			
					}							
				}
			
			if (msg!="")
			{
				msg="Please enter the following information:\n" + msg
				alert(msg);
				return false;
			}
			else
				return true;
}


/*---*/		
		function validateitIS(theForm)
		{
			var msg="";
			if (document.Form1.ddlCurrency.value == 0)
				msg +="- Currency\n" 
			if (document.Form1.txtSalary.value == "")
				msg +="- Salary\n" 
			if (document.Form1.ddlRequestedYears.value == 0)
				msg +="- Requested Years\n"
			if (document.Form1.txtRequestedAmount.value == "")
				msg +="- Loan Amount\n" 
			if (document.Form1.txtDownPaymentRatio.value == "")
				msg +="- Down Payment Amount\n" 
			if (document.Form1.ddlDBYear.value == "0")
				msg +="- Year of Birth\n"
			if (document.Form1.ddlDBMonth.value == "0")
				msg +="- Month of Birth\n"
			if (document.Form1.ddlDBDay.value == "0")
				msg +="- Day of Birth\n"
			if (document.Form1.txtSalary.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtSalary.value) || !CheckNotLongInteger(document.Form1.txtSalary.value))
						msg +="- a valid salary\n"
				}
			if (document.Form1.txtRequestedAmount.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtRequestedAmount.value) || !CheckNotLongInteger(document.Form1.txtRequestedAmount.value))
						msg +="- a valid amount\n"
					
				}
			if (document.Form1.txtDownPaymentRatio.value != "")
				if (document.layers||document.all||document.getElementById)
				{
					if (!CheckNumber(document.Form1.txtDownPaymentRatio.value) || !CheckNotLongInteger(document.Form1.txtDownPaymentRatio.value))
						msg +="- a valid amount\n"
					else
					{
						if (!CheckBetween(eval(document.Form1.txtDownPaymentRatio.value / document.Form1.txtRequestedAmount.value * 100),20,100))	
								msg +="- You should pay at least 20% of the house's amount.\n"		
					}	
					
				}
			
			
			if (msg!="")
			{
				msg="Please enter the following information:\n" + msg
				alert(msg);
				return false;
			}
			else
				return true;
		}
		
		
		function CheckNumber(a)
		{
			var x= a
			var anum=/(^\d+$)|(^\d+\.\d+$)/
			if (!anum.test(x))
			{
				testresult=false
			}
			else
			testresult=true
			return testresult
		}
		function CheckNotLongInteger(a)
		{
			var x= a 
			if (x.length > 12)
			{
				testresult=false
			}
			else
			testresult=true
			return testresult
		}
		function CheckBetween(a,b,c)
		{
			var x = a 
			if ((x >= b) && (x <= c))
			{
				testresult=true
			}
			else
			testresult=false
			return testresult
		}
	

	
// JavaScript Document