// JavaScript Document 
///Written by Peter.K.R FIRSTusable bangalore followed by Prototype Library


/////////////Master class
function acerMasterClass(){
	
		var ResponsWritePlace;
		var LoadedContent;

		this.CreateAJAXRequest=function(url,rPlace,pars,lContent){
		
		ResponsWritePlace=rPlace;
		LoadedContent=lContent;
		pars=pars+"&killCache="+new Date().getTime();
		ajaxURL=url;
		if($('loadingDIV')){
			Element.show("loadingDIV")
		}

		var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: pars, 
				onSuccess: CallSucess,
				onFailure:CallError,
				onComplete: showResponse
			}
		);
	}
	
	function CallSucess(){
		//alert('success')
	}
		
	function CallError(){
		alert('Your Request Failed \n --------  '+ajaxURL);
	}
	
///lightbox hiding 
	this.hideLightBoxOuterControl=function(){
		if(browser=="Internet Explorer"){
			commonUseLightBox1= new lightbox(); //for hideSelects function
			commonUseLightBox1.hideSelects('visible');
			commonUseLightBox1.setScroll(0,getCurrentScrollY);
			commonUseLightBox1.prepareIE('auto', 'hidden','auto');
		}
			
			if($('lbContent')){
				Element.remove($('lbContent'));
			}
			Element.hide($('overlay'));
			Element.hide($('lightbox'));
	}
	
	this.ShowLightBoxOuterControl=function(){
		if(browser=="Internet Explorer"){
			commonUseLightBox1= new lightbox(); //for hideSelects function
			commonUseLightBox1.hideSelects('hidden');
			commonUseLightBox1.getScroll();
			commonUseLightBox1.prepareIE('100%', 'hidden','hidden');
			commonUseLightBox1.setScroll(0,0);
		}
			
			Element.show($('overlay'));
			Element.show($('lightbox'));
	}
	
	this.ChangeLBPosSize=function(type){
		
			if(type==1){
				$('lightbox').style.width='700px'
				$('lightbox').style.height='500px'
				$('lightbox').style.left='40%'
				$('lightbox').style.top='45%'
	
				}
			else if(type==2){
				$('lightbox').style.width='600px'
				$('lightbox').style.height='330px'
				$('lightbox').style.left='45%'
				$('lightbox').style.top='40%'
				}
			else if(type==3){
				$('lightbox').style.width='500px'
				$('lightbox').style.height='300px'
				$('lightbox').style.left='55%'
				$('lightbox').style.top='60%'
				}
		
		}
		
	function showResponse(originalRequest){
		
		//this checking it is normal MASTER PAGES Request or lightbox submition? 
		//First one is normal MASTER PAGES AJAX Request
			
			///remove already available(prevoius loaded) element
		if(ResponsWritePlace!="noPrintRequired" || LoadedContent!="NoContent"){
			
			
			///remove already available(prevoius loaded) element
			if($(LoadedContent)){Element.remove($(LoadedContent));}
			
				//put returned XML in the Container
				info = "<div id="+LoadedContent+">" + originalRequest.responseText + "</div>";
				
				new Insertion.Before($(ResponsWritePlace), info);//this enable javascript in loaded page
				
				if(LoadedContent=="lbContent"){//problem for FireFox 
					$('lightbox').className = "done";
				}
				if($('loadingDIV')){
					Element.hide("loadingDIV")
				}

		}//if end
		//Lightbox control after request over
		else{
				//$('responseText').value=originalRequest.responseText;
				//alert(originalRequest.responseText);
				//return false;
				//for avoiding responsetext's string conversion pblm that I stored into hidden TEXT Box
				var cutResponse= new Array();
				if($('responseText')){//if obj available
					$('responseText').value=originalRequest.responseText;
					cutResponse=$('responseText').value.split('+++');
					$('responseText').value=cutResponse[0];
				}
				///---------------------Registration--------------------------------------
				if(cutResponse[0]=="catDuplication"){//email or project duplication error for client,team
					$(cutResponse[1]).focus();
					$(cutResponse[1]).className='redBorder';
					Effect.Appear("messageBoxLB");
					$('messageWriterTDLB').innerHTML='<span> <img src="../images/icons/exclamation.gif" width="16" height="16" align="absmiddle"  /> '+cutResponse[2]+' </span>'
				}
				else if(cutResponse[0]=="refreshCategoryM"){//email or project duplication error for client,team
					location.href=cutResponse[3]+"&messageShow=1&message="+cutResponse[2]
				}
				else if(cutResponse[0]=="updateSpecTitelManager"){
					acerMaster.ChangeLBPosSize(2);
					acerMaster.ShowLightBoxOuterControl();			
					acerMaster.CreateAJAXRequest("../admin/specs_title_manager.asp","lbLoadMessage","showMess=1&Message="+cutResponse[2]+"&"+cutResponse[3],"lbContent");							
					

				}


		}//else content
	}
	

		
		this.validateForm=function(formObj,fields,URL,action,messageTable,submitType){

			if($('messageBox')){
				$('messageBox').style.display="none";
			}
			
			cutFieldParams=fields.split(',');
			
			compareFieldBool=false;compareFieldFirstVal="";ErrorCount=0;
			
			//reseting
			for(i=0;i<cutFieldParams.length;i++){
				getValidType=cutFieldParams[i].split("##");
				eval("document."+formObj+"."+getValidType[0]).className="";
			}
			
			for(i=0;i<cutFieldParams.length;i++){
				getValidType=cutFieldParams[i].split("##");
				if(getValidType[1]=="text"){//blank as text
					if(eval("document."+formObj+"."+getValidType[0]+".value")==""){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}
					if(getValidType[0]=="uname" && eval("document."+formObj+"."+getValidType[0]+".value")!=""){
						var illegalChars = /\W/;
						if (eval("document."+formObj+"."+getValidType[0]+".value").length < 5) {
							eval("document."+formObj+"."+getValidType[0]).className="redBorder";
							ErrorCount++;
						} else if (illegalChars.test(eval("document."+formObj+"."+getValidType[0]+".value")))  {
							eval("document."+formObj+"."+getValidType[0]).className="redBorder";
							ErrorCount++;
						}
					}
				}
				else if(getValidType[1]=="compare"){//compare password
					if(eval("document."+formObj+"."+getValidType[0]+".value")==""){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}
					else if(eval("document."+formObj+"."+getValidType[0]+".value").length<6){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
						}
					else if(eval("document."+formObj+".password.value")!=eval("document."+formObj+".confirmPassword.value")){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}
					
				}
				else if(getValidType[1]=="email"){//email validation
					
					if(eval("document."+formObj+"."+getValidType[0]+".value")==""){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}
					else if(!emailValidation(eval("document."+formObj+"."+getValidType[0]+".value"))){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}
				}
				else if(getValidType[1]=="select"){//select box validation
					if(eval("document."+formObj+"."+getValidType[0]+".selectedIndex")==0){
						eval("document."+formObj+"."+getValidType[0]).className="redBorderSelect";
						ErrorCount++;
					}
				}
				else if(getValidType[1]=="num"){//numerical validation
					if(eval("document."+formObj+"."+getValidType[0]+".value")==""){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}
					else if(isNaN(eval("document."+formObj+"."+getValidType[0]+".value"))){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}//else if
				}//else if num
				else if(getValidType[1]=="notblankEmail"){//Email validation not mandatory if enter some thing
					if(eval("document."+formObj+"."+getValidType[0]+".value")!=""){
						if(!emailValidation(eval("document."+formObj+"."+getValidType[0]+".value"))){
							eval("document."+formObj+"."+getValidType[0]).className="redBorder";
							ErrorCount++;
						}
					}
				}//else if num
				else if(getValidType[1]=="File"){//FILE
					if(eval("document."+formObj+"."+getValidType[0]+".value")==""){
						eval("document."+formObj+"."+getValidType[0]).className="redBorder";
						ErrorCount++;
					}
					else{
						
						if(!checkExtension(eval("document."+formObj+"."+getValidType[0]))){
							eval("document."+formObj+"."+getValidType[0]).className="redBorder";
							ErrorCount++;
						}
						
					}
				}
				else if(getValidType[1]=="notblankFile"){//FILE extension validation if not mandatory
					if(eval("document."+formObj+"."+getValidType[0]+".value")!=""){
						if(!checkExtension(eval("document."+formObj+"."+getValidType[0]))){
							eval("document."+formObj+"."+getValidType[0]).className="redBorder";
							ErrorCount++;
						}
					}
				}

			}///for
			
			if(ErrorCount>0){
				if (messageTable=="LB"){
					if($('messageBoxLB')){
						$('messageWriterTDLB').innerHTML='<span> <img src="../images/icons/exclamation.gif" width="16" height="16" align="absmiddle"  /> Error! Please fill all mandatory fields marked as <span class="mandatoryStar" >*<span> </span>'
						Effect.Appear("messageBoxLB");
						
					}
				}
				else{
					if($('messageBoxMaster')){
						$('messageMasterWriterTD').innerHTML='<span> <img src="../images/icons/exclamation.gif" width="16" height="16" align="absmiddle"  /> Error! Please fill all mandatory fields marked as <span class="mandatoryStar" >*<span> </span>'
						Effect.Appear("messageBoxMaster");
						
					}
				}
				
			}//if
			else{
				if($('messageBoxMaster')){
					$('messageBoxMaster').style.display="none";
				}
				if($('messageBoxLB')){
					$('messageBoxLB').style.display="none";
				}
				ObjToClose="";
				
				if (submitType=="normal"){
					
					//alert(true);
					eval("document."+formObj).submit();
					Form.disable(formObj);
				}
				else {//or ajax submit
				
					acerMaster.CreateAJAXRequest(URL,'noPrintRequired','action='+action+'&ObjIdToClose='+ObjToClose+'&'+Form.serialize(formObj),'NoContent');
				
				}
			}//else
		}//Validate function
		
		//email validation
		function emailValidation(ObjValue){
				cutEmailAt=ObjValue.split("@");
				cutEmailDot=ObjValue.split(".");
				if(cutEmailAt.length<2 || cutEmailAt.length>2 ){
					return false;
				}
				else if(cutEmailDot.length<2){
					return false;
				}
				else{
					return true; 
				}
		}
		//extension checking Added on 24th Aug 2007
		function checkExtension(Obj){
				cutAcceptEXT=Obj.accept.split(",");
				dot=Obj.value.lastIndexOf("."); 
				fileNamelength=Obj.value.length
				var extension = Obj.value.substr(dot+1,fileNamelength); 
				checkRightExtension=false;
				for(j=0;j<cutAcceptEXT.length;j++){
					if (cutAcceptEXT[j]==extension){
						checkRightExtension=true;	
					}
				}
				return checkRightExtension;
		}
		
///user Action
	this.ConfirmBOX=function(action,uname,URL,param,MessageAddition){
		if($('userActionMessage')){
			Element.hide('userActionMessage');
		}
		
		if(action=="enable"){
			ConfVal=confirm("You are about to Enabling Visiblity of : "+uname)
			if(ConfVal==1){
				ObjToClose="";
				acerMaster.CreateAJAXRequest(URL,'noPrintRequired',param+"&uname="+uname,'NoContent');	
			}
		}
		else if(action=="disable"){
			ConfVal=confirm("You are about to Disabling visiblity of : "+uname)
			if(ConfVal==1){
				acerMaster.CreateAJAXRequest(URL,'noPrintRequired',param+"&uname="+uname,'NoContent');	
			}
		}
		else if(action=="delete"){
			ConfVal=confirm("You are about to Deleting : "+uname)
			if(ConfVal==1){
				acerMaster.CreateAJAXRequest(URL,'noPrintRequired',param+"&uname="+uname,'NoContent');	
			}

		}
		
		else if(action=="deleteSpecTitle"){
			ConfVal=confirm("You are about to Deleting : "+uname+"\n\n ****************************************** \n\n This will be delete all entries applied with this Title for each Products OR You can rename this Title ")
			if(ConfVal==1){
				acerMaster.CreateAJAXRequest(URL,'noPrintRequired',param+"&uname="+uname,'NoContent');	
			}

		}
		
		else if(action=="deleteCat"){
			ConfVal=confirm("You are about to Deleting : "+uname+"\n\n ****************************************** \n\n This will be delete all the Products and product's details under this Category ")
			if(ConfVal==1){
				acerMaster.CreateAJAXRequest(URL,'noPrintRequired',param+"&uname="+uname,'NoContent');	
			}

		}


	}


////////////////////text search////////////////////////////////

		this.doHighlight=function(bodyText, searchTerm, highlightStartTag, highlightEndTag) 
		{
		  // the highlightStartTag and highlightEndTag parameters are optional
		  if ((!highlightStartTag) || (!highlightEndTag)) {
			//highlightStartTag = "<font style='color:blue; background-color:yellow;'>";
		   // highlightEndTag = "</font>";
		   objTp='genuineTooltip';
		   objPos="down";
		   highlightStartTag = "<a href='#' style='font-weight:bold;text-decoration:underline;cursor:help;' onmouseover='acerMaster.setPosition(this,objTp,objPos);Element.show(objTp)';  onmouseout='Element.hide(objTp)' >";
		   highlightEndTag = "</a>";
		  }
		  
		  var newText = "";
		  var i = -1;
		  var lcSearchTerm = searchTerm.toLowerCase();
		  var lcBodyText = bodyText.toLowerCase();
			
		  while (bodyText.length > 0) {
			i = lcBodyText.indexOf(lcSearchTerm, i+1);
			if (i < 0) {
			  newText += bodyText;
			  bodyText = "";
			} else {
			  // skip anything inside an HTML tag
			  if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
				// skip anything inside a <script> block
				if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
				  newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
				  bodyText = bodyText.substr(i + searchTerm.length);
				  lcBodyText = bodyText.toLowerCase();
				  i = -1;
				}
			  }
			}
		  }
		  
		  return newText;
		}
		
		
		this.highlightSearchTerms=function(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
		{
		  if (treatAsPhrase) {
			searchArray = [searchText];
		  } else {
			searchArray = searchText.split(" ");
		  }
		  
		  if (!document.body || typeof(document.body.innerHTML) == "undefined") {
			if (warnOnFailure) {
			  //alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
			}
			return false;
		  }
		  
		  var bodyText = $('productExploreDiv').innerHTML;
		  for (var i = 0; i < searchArray.length; i++) {
			bodyText = acerMaster.doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
		  }
		  
		  $('productExploreDiv').innerHTML = bodyText;
		  return true;
		}

///////////layer Pos

	/****Set layer Position******/
	this.setPosition=function(inputObj,LayerObj,Type){
		
		
		height=$(LayerObj).style.height;
		width=$(LayerObj).style.width
		
		var leftPos = (DivTooltip_getLeftPos(inputObj) + inputObj.offsetWidth);
		var topPos = DivTooltip_getTopPos(inputObj);
		
			
		getScreenWidth=screen.availWidth;
		getScreenHeight=screen.availHeight;


		if(Type!="top"){
			
			if((getScreenWidth-leftPos)<450){
			$(LayerObj).style.left=(leftPos-(parseInt(width))) + 'px';
			}
			else{
			$(LayerObj).style.left=(leftPos-52) + 'px';
			}
			if((getScreenHeight-topPos)<430){
				$(LayerObj).style.top=(topPos-((parseInt(height))-62)) + 'px';
			}
			else{
				
				$(LayerObj).style.top=(topPos+13) + 'px';
			}
		}
		else{
			
			//only for tooltip
			if((getScreenWidth-leftPos)<300){
				$(LayerObj).style.left=(leftPos-(parseInt(width))+8) + 'px';
				//$(LayerObj).style.background="url(images/toolTipBg_reverse.gif) no-repeat";
			}
			else{
				$(LayerObj).style.left=(leftPos-17) + 'px';
			}
			$(LayerObj).style.top=(topPos-((parseInt(height))+10)) + 'px';
		}
		
	}
	
	function DivTooltip_getTopPos(inputObj)
	{		
	  var returnValue = inputObj.offsetTop;
	  while((inputObj = inputObj.offsetParent) != null){
		if(inputObj.tagName!='HTML')returnValue += inputObj.offsetTop;
	  }
	  return returnValue;
	}
	
	function DivTooltip_getLeftPos(inputObj)
	{
	  var returnValue = inputObj.offsetLeft;
	  while((inputObj = inputObj.offsetParent) != null){
		if(inputObj.tagName!='HTML')returnValue += inputObj.offsetLeft;
	  }
	  return returnValue;
	}
	/************/


}

acerMaster=new acerMasterClass();

/////////////////////////////////acer Master class End



///****************/common scripts Start*/
getBrowserInfo();
window.onload=function(){
	
	getBrowserInfo();
	////Menu settings-- Top, Left, Action to link & layer(Mouseover, Mouseout & onclick)
		
	getHML2Tds=$('headMenuLevel2Table').getElementsByTagName("td");
	
	if(browser=="Internet Explorer"){
		$('headMenuLevel2Table').style.top="-10px"
	}

	//corporate menu settings
//	-----------------------------------
	getHML2Tds[0].onmouseover=function(){
		if(this.className!="mSelected"){
			this.className="mOver";
		}
		hideShowSelect("none")
		Element.show('corporateSub');
		
	}
	getHML2Tds[0].onmouseout=function(){
		if(this.className!="mSelected"){
			this.className="";
		}
		hideShowSelect("block")
		Element.hide('corporateSub');
	}
	
	$('corporateSub').style.left="-1"
	$('corporateSub').style.top="-6"
	createHighLight('corporateSubTable');
	
	$('corporateSub').onmouseover=function(){
		if(getHML2Tds[0].className!="mSelected"){
			getHML2Tds[0].className="mOver";
		}
		hideShowSelect("none")
		Element.show('corporateSub');
	}
		
	$('corporateSub').onmouseout=function(){
		if(getHML2Tds[0].className!="mSelected"){
			getHML2Tds[0].className="";
		}
		hideShowSelect("block")
		Element.hide('corporateSub');
	}
//	-----------------------------------
	
	
	getHML2Tds[1].onmouseover=function(){
		if(this.className!="mSelected"){
			this.className="mOver";
		}
		hideShowSelect("none")
		Element.show('productsSub');
	}
	getHML2Tds[1].onmouseout=function(){
		if(this.className!="mSelected"){
			this.className="";
		}			
		hideShowSelect("block")
		Element.hide('productsSub');
	}
	
	$('productsSub').style.left="96"
	$('productsSub').style.top="-6"
	createHighLight('productsSubTable');
	
	$('productsSub').onmouseover=function(){
		if(getHML2Tds[1].className!="mSelected"){
			getHML2Tds[1].className="mOver";
		}
		hideShowSelect("none")
		Element.show('productsSub');
		}
	$('productsSub').onmouseout=function(){
		if(getHML2Tds[1].className!="mSelected"){
			getHML2Tds[1].className="";
		}
		hideShowSelect("block")
		Element.hide('productsSub');
		}
	
//	-----------------------------------

	getHML2Tds[2].onmouseover=function(){
		if(this.className!="mSelected"){
			this.className="mOver";
		}
		hideShowSelect("none")
		Element.show('supportSub');
	}
	getHML2Tds[2].onmouseout=function(){
		if(this.className!="mSelected"){
			this.className="";
		}
		hideShowSelect("block")
		Element.hide('supportSub');
	}
	
	$('supportSub').style.left="194"
	$('supportSub').style.top="-6"
	createHighLight('supportSubTable');
	
	$('supportSub').onmouseover=function(){
		if(getHML2Tds[2].className!="mSelected"){
			getHML2Tds[2].className="mOver";
		}
		hideShowSelect("none")
		Element.show('supportSub');
		}
	$('supportSub').onmouseout=function(){
		if(getHML2Tds[2].className!="mSelected"){
			getHML2Tds[2].className="";
		}
		hideShowSelect("block")
		Element.hide('supportSub');
		}
	
//	-----------------------------------
	getHML2Tds[3].onmouseover=function(){
		if(this.className!="mSelected"){
			this.className="mOver";
		}
		hideShowSelect("none")
		Element.show('pressSub');
	}
	getHML2Tds[3].onmouseout=function(){
		if(this.className!="mSelected"){
			this.className="";
		}
		hideShowSelect("block")
		Element.hide('pressSub');
	}
	
	$('pressSub').style.left="285"
	$('pressSub').style.top="-6"
	createHighLight('pressSubTable');
	
	$('pressSub').onmouseover=function(){
		if(getHML2Tds[3].className!="mSelected"){
			getHML2Tds[3].className="mOver";
		}
		hideShowSelect("none")
		Element.show('pressSub');
		}
	$('pressSub').onmouseout=function(){
		if(getHML2Tds[3].className!="mSelected"){
			getHML2Tds[3].className="";
		}
		hideShowSelect("block")
		Element.hide('pressSub');
		}
	
//	-----------------------------------
	
	getHML2Tds[4].onmouseover=function(){
		if(this.className!="mSelected"){
			this.className="mOver";
		}
		hideShowSelect("none")
		Element.show('careersSub');
	}
	getHML2Tds[4].onmouseout=function(){
		if(this.className!="mSelected"){
			this.className="";
		}
		hideShowSelect("block")
		Element.hide('careersSub');
	}
	
	$('careersSub').style.left="364"
	$('careersSub').style.top="-6"
	createHighLight('careersSubTable');
	
	$('careersSub').onmouseover=function(){
		if(getHML2Tds[4].className!="mSelected"){
			getHML2Tds[4].className="mOver";
		}
		hideShowSelect("none")
		Element.show('careersSub');
		}
	$('careersSub').onmouseout=function(){
		if(getHML2Tds[4].className!="mSelected"){
			getHML2Tds[4].className="";
		}
		hideShowSelect("block")
		Element.hide('careersSub');
		}
	
//	-----------------------------------


//	-----------------------------------
	
	getHML2Tds[5].onmouseover=function(){
		if(this.className!="mSelected"){
			this.className="mOver";
		}
		hideShowSelect("none")
		Element.show('dgsndSub');
	}
	getHML2Tds[5].onmouseout=function(){
		if(this.className!="mSelected"){
			this.className="";
		}
		hideShowSelect("block")
		Element.hide('dgsndSub');
	}
	
	$('dgsndSub').style.left="443"
	$('dgsndSub').style.top="-6"
	createHighLight('dgsndSubTable');
	
	$('dgsndSub').onmouseover=function(){
		if(getHML2Tds[5].className!="mSelected"){
			getHML2Tds[5].className="mOver";
		}
		hideShowSelect("none")
		Element.show('dgsndSub');
		}
	$('dgsndSub').onmouseout=function(){
		if(getHML2Tds[5].className!="mSelected"){
			getHML2Tds[5].className="";
		}
		hideShowSelect("block")
		Element.hide('dgsndSub');
		}
	
//	-----------------------------------




	MM_preloadImages('../images/dropdown_menu_bg_over.gif');
	
	////Attaching event
	//corporate
	var corpTDTags = $('corporateSubTable').getElementsByTagName("td");
	corpTDTags[0].onclick=function(){
		location.href="../corporate/profile.asp"
	}
	corpTDTags[1].onclick=function(){
		location.href="../corporate/intellectual_property.asp"
		
	}
	corpTDTags[2].onclick=function(){
		location.href="../corporate/strategic_partners.asp"
		
	}
	corpTDTags[3].onclick=function(){
		location.href="../corporate/contactus.asp"
		
	}
	
		
}


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];}}
}


///highlight & rollover
   var elem = "td";
   var rClick=false;
   var c=0
   var Hlength=0;
   addSArrayBool=false;
function createHighLight(Obj,td){
		if(document.getElementsByTagName){
			if(td=='tr'){
				elem='tr';
				}
			else{
				elem='td';
			}
			
			var el = document.getElementById(Obj).getElementsByTagName(elem);
			if(td=='tr'){Hlength=el.length;	}else{Hlength=el.length;}

			
			for(var i=0; i<Hlength; i++){
			
			 el[i].onmouseover = function(){
				this.oldClassName=this.className
				
					if(this.className=="menuSelected"){
						this.className = "menuSelected";
					}
					else if(this.className=="selectedMenu"){
						this.className = "selectedMenu";
					}
					else if(this.className=="subMenu"){
						this.className = "subMenuMenuOver";
					}
					else if(this.className=="selectedMenuSub"){
						this.className = "selectedMenuSub";
					}
					else if(this.className=="subMenuMenuSelected"){
						this.className = "subMenuMenuSelected";
					}

					else if(this.className=="menuSelecteddOWN"){
						this.className = "menuSelecteddOWN";
					}
					else{
						this.className = "menuOver";	
					}
			 }
			 el[i].onmouseout = function(){
					if(rClick==false || this.className!="selectedMenu"){
						this.className =this.oldClassName;
			 		}
			  }
			}
		}
}

function selectMainMenu(index,Obj){
	getTdElements=$(Obj).getElementsByTagName("td");
	getTdElements[index].className="mSelected"
}

function selectSubmenu(index,Obj,classX){

	if($(index) && $(index).id ){
		
		if(classX=="down"){
			$(index).className="menuSelecteddOWN"
		}
		
		else if(classX=="subMenu"){
			$(index).className="subMenuMenuSelected"
		}

		else{
			$(index).className="menuSelected"
		}
		
	}
	else{
	getTdElements=$(Obj).getElementsByTagName("td");
	getTdElements[index].className="menuSelected"
	}
}


function hideShowSelect(action){
	if(browser=="Internet Explorer")
	if($('masterContentTable')){
		getSelects=$('masterContentTable').getElementsByTagName('select');
			for(i=0;i<getSelects.length;i++){
				getSelects[i].style.display=action
			}
	}
}

///****************/common scripts End*/
