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];}
}

/********Drop Down Paragraph*********/
var active = "";
var ad = "";
function collapse(id)
{
	if(document.getElementById("drop"+id).style.display == "block"){
		document.getElementById("drop"+id).style.display = "none";
		document.getElementById("a"+id).className="toggle";
	} else {
		if(active != ""){
			active.style.display = "none";
			ad.className = "toggle";
		}
		document.getElementById("drop"+id).style.display = "block";
		document.getElementById("a"+id).className="toggle-on";
		active = document.getElementById("drop"+id);
		ad = document.getElementById("a"+id);
	}
}
function toggleBlock(d, i)
{
	var e = MM_findObj(d);
	var img = MM_findObj(i);
	if (!e) return;
	if (e.style.display == "block"){
		e.style.display = "none";
		img.src = "images/products-features.jpg";
	} else {
		e.style.display = "block";
		img.src = "images/products-features-o.jpg";
	}
}
function toggleBlock1(d1, i1)
{
	var e1 = MM_findObj(d1);
	var img1 = MM_findObj(i1);
	if (!e1) return;
	if (e1.style.display == "block"){
		e1.style.display = "none";
		img1.src = "images/how-to-apply.jpg";
	} else {
		//alert(img1);
		e1.style.display = "block";
		img1.src = "images/how-to-apply-o.jpg";
	}
}
/*function toggleBlock2(d2, i2)
{
	var e2 = MM_findObj(d2);
	var img2 = MM_findObj(i2);
	if (!e2) return;
	if (e2.style.display == "block"){
		e2.style.display = "none";
		img2.src = "images/cfc-customers.gif";
	} else {
		e2.style.display = "block";
		img2.src = "images/cfc-customers-o.gif";
	}
}*/
var actived = "";
var aded = "";
function collapse_privelage()
{
	if(document.getElementById("customers").style.display == "block"){
		document.getElementById("customers").style.display = "none";
		document.getElementById("privelage_a").className="toggle-privelage";
	} else {
		if(actived != ""){
			actived.style.display = "none";
			aded.className = "toggle-privelage";
		}
		document.getElementById("customers").style.display = "block";
		document.getElementById("privelage_a").className="toggle-privelage-on";
		actived = document.getElementById("customers");
		aded = document.getElementById("privelage_a");
	}
}

function popup(){
document.getElementById("popupmenu").style.display = "block"
}
function closepopup()
{
document.getElementById("popupmenu").style.display = "none"
}


/*Pop Up*/
function popImage(img, caption)
{
	caption = escape(caption);
	openIT('pop_gl.htm?img='+img+"&caption="+caption,800,550);
}
function popImageV2(img, caption,bottomcaption)
{
	caption = escape(caption);
	openIT('pop_gl.htm?img='+img+"&caption="+caption+"&bottomcaption="+bottomcaption,800,550);
}

function popImageDownLoad(img, caption)
{
	caption = escape(caption);
	openIT('pop_gl1.htm?img='+img+"&caption="+caption,800,550);
	//window.open("pop_gl1.htm?img='+img+"&caption="+caption", '',"width=800,height=550,scrollbars=yes,resizable=yes,left=100,top=50");
}

function openIT(u,W,H, sc) {
		var x = (screen.width - W) / 2;
		var y = (screen.height - H) / 2;
		//window.open(u, '',"width="+W+",height="+H+",scrollbars="+(sc ? "yes" : "no")+",resizable=Yes, left="+x+",top="+y);
		window.open(u, '',"width="+W+",height="+H+",scrollbars=yes,resizable=Yes, left="+x+",top="+y);
}

/************************** Validate ContactUs Form ********************/
function ValidateContactForm()
  {
   var msg;
   var msg2;
   msg=""
    msg2="";
    if (document.getElementById('txtFName').value=="")
		msg +="- First name\n" 
		 if (document.getElementById('txtMName').value=="")
		msg +="- Middle name\n" 
	if (document.getElementById('txtLName').value=="")
		msg +="- Family Name\n" 
	if (document.getElementById('txtEmail').value=="")
		msg +="- Email Address \n"	
	else{
		if (IsValidEmailAddress(document.getElementById('txtEmail'))==false)
	   msg2="- Invalid mail address \n"}
	   	if (document.getElementById('txtAddress').value=="")
		msg +="- Adress \n"	
		if (document.getElementById('txtCity').value=="")
		msg +="- City \n"	
		if (document.getElementById('txtPhone').value=="")
		msg +="- Phone \n"	
	if (document.getElementById('txtComments').value=="")
		msg +="- Comments \n"	
	if (msg!="")
	{
	   msg="Please enter the following information:\n" + msg +msg2
		alert(msg);
		return false;
	}
	else{
	   if (msg2==""){
	   return true;
	   }else{
	    alert(msg2);
		return false;}
		}
	}
  
    function IsValidEmailAddress(txt){
	if(txt.value !=""){ 
		var goodEmail = txt.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
		if (goodEmail){
			return true;
		} else {
			return false;
		}
	}
}
/**********************************************************************/