// SCRIPT FOR HOME PAGE JAVASCRIPT 

function hidtxt(name)
{
 
  var txtname=name;
 // alert(txtname.value);
  if(txtname.value=="Name" ||txtname.value=="Email" || txtname.value=="Phone" || txtname.value=="Country")
  {
  txtname.value="";
  }
}


startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("services");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace (" over", "");
   }
   }
  }
 }
}
window.onload=startList;
// ----------------------------------------

function toggleBox(boxId) {
	if (document.getElementById(boxId).style.display == "none" )
			document.getElementById(boxId).style.display = "block";
	else
			document.getElementById(boxId).style.display = "none";
	
}

function playLogos() {
logos = new Array(29);
logos[0] = "australianhighcommission.gif"
logos[1] = "bilt.gif"
logos[2] = "britishcouncil.gif"
logos[3] = "cii.gif"
logos[4] = "coca-colaindia.gif"
logos[5] = "dabur.gif"
logos[6] = "dabur_pharma.gif"
logos[7] = "dmrc.gif"
logos[8] = "dutyfree.gif"
logos[9] = "gail.gif"
logos[10] = "hewitt.gif"
logos[11] = "hotelassociationofindia.gif"
logos[12] = "indianrailways.gif"
logos[13] = "indorama.gif"
logos[14] = "journeymart.gif"
logos[15] = "lml.gif"
logos[16] = "max.gif"
logos[17] = "ministryoftourism.gif"
logos[18] = "nhai.gif"
logos[19] = "nokia.gif"
logos[20] = "ntpc.gif"
logos[21] = "pepsi.gif"
logos[22] = "railtel.gif"
logos[23] = "ranbaxy.gif"
logos[24] = "rpg.gif"
logos[25] = "sail.gif"
logos[26] = "tata-steel.gif"
logos[27] = "tataindicom.gif"
logos[28] = "vintron.gif"

		index = Math.floor(Math.random() * logos.length);
		document.getElementById('logo').src = "../portfolio/logos/" + logos[index];
		window.setTimeout('playLogos()', 2000);
}

function WriteEmail() {
	Name = "marketing"
	Domain = "netcommlabs.com"
	SubLine = "subject=Business Enquiry"
	document.write("<a href='mailto:" + Name + "@" + Domain + "?" + SubLine + "'>");
	document.write(Name + "@" + Domain);
	document.write("</a>");
}
var IE = document.all;
function opencssWin(fileName, fwidth, fheight){
	var _pLayer=document.getElementById('popupWin').style;
	var _pDisplay =document.getElementById('popupDiv');
	var _pStatus=_pLayer.visibility;
		// Capture browser window size
		if (IE) {
			screenWidth = (document.body.clientWidth + 20);
			screenHeight = (document.body.clientHeight);
		} else {
	 		screenWidth = self.innerWidth;
			screenHeight= self.innerHeight;
		}

			// Evaluate left position for the current browser width
			leftPos = (screenWidth/2) -  (fwidth/2);
	 		topPos  = (screenHeight/2) - (fheight/2);

		if (_pStatus=="hidden") {
			if(IE)
				document.getElementById('container').style.filter="Alpha(Opacity=40)";
			else
 			document.getElementById("container").setAttribute("style","-moz-opacity:.4;");
			_pLayer.left=leftPos+'px';
			_pLayer.top=topPos+'px';
			_pDisplay.src = fileName;
			_pLayer.width=fwidth;
			_pLayer.height=fheight;
	 		_pLayer.visibility="visible";
		}else{
			if(IE)
			document.getElementById('container').style.filter="Alpha(Opacity=100)";
			else
			document.getElementById('container').setAttribute("style","-moz-opacity:1;");
	 		_pLayer.visibility="hidden";
		}
}

/*  CSS windoow and iframe to be used in pages for the popup window*/
cHTML='<div id="popupWin" style="width: 0px; height: 0px; position: absolute; visibility: hidden; background-color: #ffffff; z-index: 20;">\
	<div style="border: 1px solid #ffffff;" onClick="javascript:opencssWin(1,1,1);"><img id="popupDiv" alt="" src="" /></div>\
</div>'
document.write(cHTML)
