<!--

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 findPos(start_obg) 

{

	var curleft = curtop = 0;

	

	for (obj = start_obg; obj != null; obj = obj.offsetParent)

	{

		curleft += obj.offsetLeft;

		curtop += obj.offsetTop;

	}



	return [curleft,curtop];

}



var currDivName = "";



function showSubDiv(imgID, divName)

{

	if(document.getElementById(divName))

	{

		if(currDivName != "") hideSubDiv(currDivName);

		currDivName = divName;

		

		var imgTag = document.getElementById(imgID);

		var arrCoord = findPos(imgTag);

	

		var tempX = arrCoord[0];

		var tempY = arrCoord[1];

		var offsetX = 0;

		var offsetY = 33;

		//alert(imgID+":"+tempX+":"+tempY);

		var layer = document.getElementById(divName);

		layer.style.top  = (tempY + offsetY) + 'px';

		layer.style.left = (tempX + offsetX) + 'px';

		layer.className = divName + " show";

	}



}

function hideSubDiv(divName)

{

	if(document.getElementById(divName))

	{

		var layer = document.getElementById(divName);

		layer.className = divName + " hide";

	}

}



function hideAllSubDivs()

{

	hideSubDiv('aboutDiv');

	hideSubDiv('servicesDiv');

	hideSubDiv('blogDiv');

	hideSubDiv('candidatesDiv');

}



var currDivName1 = "";

var currImgName1 = "";

function showSubDiv1(imgID, divName, x , y)

{

	if(document.getElementById(divName))

	{

		if(currDivName1 != "") hideSubDiv1(currDivName1, currImgName1);

		currDivName1 = divName;

		currImgName1 = imgID;

		

		var src = "";

		if(imgID == "Image22") src = "images/socialo_01.png";

		if(imgID == "Image23") src = "images/socialo_02.png";

		if(imgID == "Image24") src = "images/socialo_03.png";

		if(imgID == "Image25") src = "images/socialo_04.png";

		if(imgID == "Image26") src = "images/socialo_05.png";

	

		var img = document.getElementById(imgID);

		img.src = src;



		var imgTag = document.getElementById(imgID);

		var arrCoord = findPos(imgTag);

	

		var tempX = arrCoord[0];

		var tempY = arrCoord[1];

		var offsetX = x;

		var offsetY = y;

		//alert(imgID+":"+tempX+":"+tempY);

		var layer = document.getElementById(divName);

		layer.style.top  = (tempY + offsetY) + 'px';

		layer.style.left = (tempX + offsetX) + 'px';

		layer.className = divName + " show";

	}



}

function hideSubDiv1(divName, imgName)

{

	if(document.getElementById(divName))

	{  

		var src = "";

		if(imgName == "Image22") src = "images/social_01.png";

		if(imgName == "Image23") src = "images/social_02.png";

		if(imgName == "Image24") src = "images/social_03.png";

		if(imgName == "Image25") src = "images/social_04.png";

		if(imgName == "Image26") src = "images/social_05.png";

	

		var img = document.getElementById(imgName);

		img.src = src;



		var layer = document.getElementById(divName);

		layer.className = divName + " hide";

	}

}



function hideAllSubDivs1()

{

	hideSubDiv1('emailDiv', 'Image25');

	hideSubDiv1('twitterDiv', 'Image24');

	hideSubDiv1('phoneDiv', 'Image26');

	hideSubDiv1('fbookDiv', 'Image23');

	hideSubDiv1('linkDiv', 'Image22');

}



function processContactReq(page)

{

	resetError();

	

	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;

	var check=/@[\w\-]+\./;

	var checkend=/\.[a-zA-Z]{2,3}$/;	



	var email = document.getElementById("email");

	var phone = document.getElementById("phone");

	var err = false;

	

	if (email.value.search(/\S/) == -1) 

	{

		displError(1, "Please enter your Email Address.");

		err = true;

	} 

	else 

	{

		if(((email.value.search(exclude) != -1)||(email.value.search(check)) == -1)||(email.value.search(checkend) == -1)) 

		{

			displError(1, "Please enter valid Email Address.");

			err = true;

		}

	}



	if (phone.value.search(/\S/) == -1) 

	{

		displError(2, "Please enter your Phone Number.");

		err = true;

	}

	else if(phone.value.length != 10  || phone.value.search(/\d{10,10}/) == -1) 

	{

		displError(2, "Phone Number format: 4167778899");

		err = true;

	}

	

	if(!err) window.location.href = "ext_process.php?type=contact&email="+email.value+"&phone="+phone.value+"&page="+page;

	

}



function displError(ind, err)

{

	document.getElementById("errBox"+ind).innerHTML = err;	

}

function resetError()

{

	document.getElementById("errBox1").innerHTML = "";	

	document.getElementById("errBox2").innerHTML = "";	

}



function grayOut(darkLayer, vis, options) {

  // Pass true to gray out screen, false to ungray

  // options are optional.  This is a JSON object with the following (optional) properties

  // opacity:0-100         // Lower number = less grayout higher = more of a blackout 

  // zindex: #             // HTML elements with a higher zindex appear on top of the gray out

  // bgcolor: (#xxxxxx)    // Standard RGB Hex color code

  // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});

  // Because options is JSON opacity/zindex/bgcolor are all optional and can appear

  // in any order.  Pass only the properties you need to set.

  var options = options || {}; 

  var zindex = options.zindex || 50;

  var opacity = options.opacity || 70;

  var opaque = (opacity / 100);

  var bgcolor = options.bgcolor || '#000000';

  var dark=document.getElementById(darkLayer);

  if (!dark) {

    // The dark layer doesn't exist, it's never been created.  So we'll

    // create it here and apply some basic styles.

    // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917

    var tbody = document.getElementsByTagName("body")[0];

    var tnode = document.createElement('div');           // Create the layer.

        tnode.style.position='absolute';                 // Position absolutely

        tnode.style.top='0px';                           // In the top

        tnode.style.left='0px';                          // Left corner of the page

        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            

        tnode.style.display='none';                      // Start out Hidden

        tnode.id=darkLayer;                   // Name it so we can find it later

    tbody.appendChild(tnode);                            // Add it to the web page

    dark=document.getElementById(darkLayer);  // Get the object.

  }

  if (vis) {

    // Calculate the page width and height 

    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {

        var pageWidth = document.body.scrollWidth+'px';

        var pageHeight = document.body.scrollHeight+'px';

    } else if( document.body.offsetWidth ) {

      var pageWidth = document.body.offsetWidth+'px';

      var pageHeight = document.body.offsetHeight+'px';

    } else {

       var pageWidth='100%';

       var pageHeight='100%';

    } 

	

    //set the shader to cover the entire page and make it visible.

    dark.style.opacity=opaque;                      

    dark.style.MozOpacity=opaque;                   

    dark.style.filter='alpha(opacity='+opacity+')'; 

    dark.style.zIndex=zindex;        

    dark.style.backgroundColor=bgcolor;  

    dark.style.width= pageWidth;

    dark.style.height= pageHeight;

    dark.style.display='block';				 

  } else {

     dark.style.display='none';

  }

}



function getWinSize()

{

   // Calculate the page width and height 

    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {

        var pageWidth = document.body.scrollWidth;

        var pageHeight = document.body.scrollHeight;

    } else if( document.body.offsetWidth ) {

      var pageWidth = document.body.offsetWidth;

      var pageHeight = document.body.offsetHeight;

    } else {

       var pageWidth='100%';

       var pageHeight='100%';

    } 

	return [pageWidth, pageHeight];

}

function changeDivPosition(name, x , y)        

{  

	var div = document.getElementById(name);

	div.style.left = x + 'px';

	div.style.top  = y + 'px';

}



//-->