/* Jquery POPUP EOF*/
 var SITE_URL='http://www.askoptions.com';
 var ADMIN_PANEL ='eshopping';
 var ADMIN_PANEL_IMG = 'http://www.askoptions.com/media/images/nc';
 var USER_PANEL_IMG = 'http://www.askoptions.com/media/images';
$(function() {
		 	
	$( "#dialog-form" ).dialog({
		autoOpen: false,
		height: 550,
		width: 650,
		resizable: true,
		closeText: 'close',
		title: 'Post Enquiry',
		modal: true,
		close: function() {
			//url = SITE_URL+"/"+ADMIN_PANEL+"/sale-quick.php?perform=list" ;
		}
	});
});
function closeDialog(){
$( "#dialog-form" ).dialog('close');
}
function postEnquiry(surl){	
	ajxUrl= surl +"&ajx=1" ;
	//$("#record_info").html('<div style="padding-top:30px">Loading...</div>'); 
	makeGETRequest(ajxUrl,'1');  //is_div_dialog=1
	//$('#record_info').load(ajxUrl);
}
var http_req_alerts ; 
function makeGETRequest(url,is_div_dialog){
	http_req_alerts = false;			
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_req_alerts = new XMLHttpRequest();
	}else if (window.ActiveXObject) { // IE
		try {
			http_req_alerts = new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e) {
			try {
				http_req_alerts = new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e) {}
		}
	}    
	if (!http_req_alerts) {
		return false;
	}  
	
	if(is_div_dialog=='1'){
		
		document.getElementById('busyimg1').style.display="block" ;
		document.getElementById('busyimg2').style.display="block" ;
		http_req_alerts.onreadystatechange = loadRecordDialog ;
		http_req_alerts.open('GET',url,true);
		http_req_alerts.send(null);
	}	
	
}

function loadRecordDialog(){
	 
	if(http_req_alerts.readyState==4){
        if (http_req_alerts.status == 200){
            var allData = http_req_alerts.responseText;
            if(allData){				
                $("#dialog-form").dialog("open");
				document.getElementById("dialog-form").innerHTML = allData; 
				document.getElementById('busyimg1').style.display="none" ;
				document.getElementById('busyimg2').style.display="none" ;
            }
        }
    }else{
		document.getElementById("dialog-form").innerHTML= '<div style="padding-top:50px"><img src="'+USER_PANEL_IMG+'/loading_circle.gif"/></div>';  			
    }
} 

function validatePostEnquiry(form1){

	var returnVal= true;	
	 
	if(returnVal==true){
  	
		var poststr = createQueryString(form1);
		 
		makePOSTRequest(SITE_URL+'/product-inquiry.php?perform=add&ajx=1', poststr,1);		
		return false;
	}
 
	return false;	

}
var http_request_pt = false;
function makePOSTRequest(url, parameters,is_div_dialog) {

      http_request_pt = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request_pt = new XMLHttpRequest();
         if (http_request_pt.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request_pt.overrideMimeType('text/xml');
            http_request_pt.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request_pt = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request_pt = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request_pt) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
	  if(is_div_dialog==1){
		document.getElementById('busyimg3').style.display="block" ;
		document.getElementById('busyimg4').style.display="block" ;
		http_request_pt.onreadystatechange = showDialogInfo ;		
	  } 
	 
      http_request_pt.open('POST', url, true);
      http_request_pt.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request_pt.setRequestHeader("Content-length", parameters.length);
      http_request_pt.setRequestHeader("Connection", "close");
      http_request_pt.send(parameters);
}
function showDialogInfo() {
    if (http_request_pt.readyState == 4) {
        if (http_request_pt.status == 200) {            
            allData = http_request_pt.responseText;			
			 
			if(allData){		
				document.getElementById('busyimg3').style.display="none" ;
				document.getElementById('busyimg4').style.display="none" ;
				document.getElementById("dialog-form").innerHTML = allData; 
			}			
        } else {
            alert('There was a problem with the request.');
			
        }
    }
}
 
/* Jquery POPUP BOF*/

function showmenu(elmnt)
{
	if(elmnt!=''){
		document.getElementById(elmnt).style.visibility="visible"
		document.getElementById(elmnt).style.display = 'block';
	}
}
function hidemenu(elmnt)
{
	if(elmnt!=''){
	document.getElementById(elmnt).style.visibility="hidden"
	}
}

function submitSearch(type){
    document.getElementById("sType1").value = type;    
    document.getElementById("frmSearch").submit();
    return false;
}
function showAllSearch(){ 
    document.getElementById("sType").value ="";    
    document.getElementById("form1").submit();
    return false;
}
function changePage(page) {
    var q_string = "?";

    if ( document.frmSearch.length ) {
        e_count = document.frmSearch.length;
        for(i=0; i<e_count; i++){
            q_string += document.frmSearch[i].name +'='+ document.frmSearch[i].value +'&';
        }
    }

    if ( page != "" && page > 0 ) {
        q_string += "&x="+ page;
    }
    else {
        q_string += "&x=1";
    }
    window.location.href = q_string;
    
    return false;
}
function changeProductList(page) {

    var q_string = "?";
   
    if ( page != "" && page > 0 ) {
        q_string += "&x="+ page;
    }
    else {
        q_string += "&x=1";
        page = 1;
    }
    //window.location.href = q_string;
    document.form1.x.value=page ;
    document.form1.submit() ;
    return false;
}
//Pagination js function BOF for ajax based
var http_req_alerts_lp;
function changeProductPage(page){  
 
    var domain = document.getElementById("domain").value;
    var category_id = document.getElementById("category_id").value;
    var search = document.getElementById("search").value;    
    var sType = document.getElementById("sType").value;    
    var sString = document.getElementById("sString").value;    
    var home_page = document.getElementById("home_page").value;    
    document.getElementById("x").value = page;

    http_req_alerts_lp = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_req_alerts_lp = new XMLHttpRequest();
    }else if (window.ActiveXObject) { // IE
        try {
            http_req_alerts_lp = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (e) {
            try {
                http_req_alerts_lp = new ActiveXObject("Microsoft.XMLHTTP");
            }catch (e) {}
        }
    }
    
    if (!http_req_alerts_lp) {
        return false;
    } 
    
    
    if(search==1){
       var uri = domain +'/get-products.php?category_id='+category_id+'&x='+page+'&sType='+sType+'&sString='+sString+'&search=1' ;      
    }
	if(category_id>0){		 
        var uri = domain +'/get-products.php?category_id='+category_id+'&x='+page ;   
	 
    }
	 
	if(home_page==1){
	  var uri = domain +'/get-products.php?home_page=1&x='+page ;   
	}
	
    http_req_alerts_lp.onreadystatechange = loadProductList;
    http_req_alerts_lp.open('GET', uri, true);
    http_req_alerts_lp.send(null);

}
function loadProductList(){
   
    var domain = document.getElementById("domain").value;
	 
    if(http_req_alerts_lp.readyState==4){
       
        if (http_req_alerts_lp.status == 200){
            var allText = http_req_alerts_lp.responseText;          
            if(allText){
			
                //document.getElementById("displayRow").innerHTML=allText;    
				var textArray = new Array();
				textArray = allText.split("~");
				var textDisplay = textArray[0];
				var textLink = textArray[1];
 				
				document.getElementById("displayRow").innerHTML=textDisplay;    				
				document.getElementById("short_link1").innerHTML=textLink;    				
				document.getElementById("short_link2").innerHTML=textLink; 
				
            }
        }
    }else{ 
                
        document.getElementById("displayRow").innerHTML=  "<div align=\"center\" style=\"border-width: 0px;  border-style: solid;  border-color: black; padding-top:100px;\"><img "
                    +" src=\""+domain+"/media/images/loading_circle.gif\"/></div>" ;  
      
        
    }
}

//Pagination js function EOF for ajax based
/*
function changePageWithExtra(page,string_e) {
    var q_string = "?";
    
    if ( page != "" && page > 0 ) {
        q_string += "&x="+ page;
    }
    else {
        q_string += "&x=1";
    }
    
    // extra url variables pass    
    q_string+= string_e ;
    window.location.href = q_string;
    return false;
}
*/


function changePageWithExtra(page,string_e) {
    //var q_string = "?";
  var q_string = "";
    

    //if ( document.frmSearch.length ) {
      //  e_count = document.frmSearch.length;
      //  for(i=0; i<e_count; i++){
     //       q_string += document.frmSearch[i].name +'='+ document.frmSearch[i].value +'&';
     //   }
    //}
   
    
    if ( page != "" && page > 0 ) {
        q_string += "&x="+ page;
    }
    else {
        q_string += "&x=1";
    }
   
    // extra url variables pass    
     q_string+= string_e ;	
     sub_url= window.location.href ;	
	 pos =  sub_url.indexOf('?');
	
	if(navigator.appName.indexOf("Microsoft")!=-1){
		if(navigator.appVersion.indexOf("MSIE 6.0") !=-1){
			document.write();
		}
	}
	 //document.write();
	 if(pos >= 0){
		  pos = parseInt(pos);
          sub_url = sub_url.substr(0,pos);		
		  url = sub_url+"?"+q_string;		  
	 }else{
		  url = sub_url+"?"+q_string ;
	 }
	
	window.location = url;
    return true;   
}

function gotoURL(url) {
    document.location = url;
}


function reallyDel(str) {
	if ( !str ) {
		str = "Do you really want to DELETE?";
	}
	if ( confirm(str) ) {
		return true;
	}
	return false;
}


function selectOnlyOne( element ) {
	var el = document.getElementsByName(element.name) ;
	for( i=0; i<el.length; i++ ) {
		if ( el[i].value != element.value ) {
			el[i].checked = false;
		}
	}	
}
function uncheckOpt(ename){
    var el = document.getElementsByName(ename) ;
    for( i=0; i<el.length; i++ ) {
        if ( el[i].checked= true ) {
            el[i].checked = false;
        }
       
    }
}

function selectAtleastOne( element ) {
    var el = document.getElementsByName(element.name) ;
    for( i=0; i<el.length; i++ ) {
        //if ( el[i].value != element.value ) {
        if ( el[i] != element ) {
            el[i].checked = false;
        }
        else if ( el[i] == element ) {
            el[i].checked = true;
        }
    }
}

function hideSelect() {
	var select_arr = window.document.getElementsByTagName("select");
	for (i=0; i<select_arr.length; i++) {
		select_arr[i].style.visibility = 'hidden';
	}
}
function showSelect() {
	var select_arr = window.document.getElementsByTagName("select");
	for (i=0; i<select_arr.length; i++) {
		select_arr[i].style.visibility = 'visible';
	}
}


/**
 * function onlyNumerics(e)
 * This function is used to restrict the input characters to 
 * digits [0-9] only, anyother key is neglected.
 *
 * @param	e		This is the Event object that has occurred. 
 *					This is mainly a hack for Mozilla browsers, in Internet Explorer it is not required.
 *
 * @return	boolean	true, if the key is accepted.
 *					false, if the key is not accepted.
 */
function onlyNumerics(e){

	var e = e? e : window.event;
	if(!e) 
		return;
	
	var key = 0;
	if (e.keycode) { 
		key = e.keycode; 
	} // for moz/fb, if keycode==0 use 'which'
	else if (typeof(e.which)!= 'undefined') { 
		key = e.which; 
	} 
	//alert(key);
	if ( (key>=46 && key<=57) || key == 8 || key ==0 ){
		return (true) ;
	}
	else{
		return (false);	
	}
}


/**
 * function onlyNumerics(e)
 * This function is used to restrict the input characters to 
 * digits [0-9] only, anyother key is neglected.
 *
 * @param	e		This is the Event object that has occurred. 
 *					This is mainly a hack for Mozilla browsers, in Internet Explorer it is not required.
 *
 * @return	boolean	true, if the key is accepted.
 *					false, if the key is not accepted.
 */
function onlyCharacters(e){
 
	var e = e? e : window.event;
  
	if(!e) 
		return;
	
	var key = 0;
	if (e.keycode) { 
		key = e.keycode; 
       
	} // for moz/fb, if keycode==0 use 'which'
	else if (typeof(e.which)!= 'undefined') { 
		key = e.which; 
	} 
   
	//alert(key);
    // 32 for space, A=65-Z=90 , a=97-z=122 
	if ( (key>=65 && key<=90) || (key>=97 && key<=122) || key == 8 || key ==0 || key==32){
		return (true) ;
	}
	else{
		return (false);	
	}
}


/**
 * function onlyClear(e)
 * This function is used to allow only Delete key event.
 *
 * @param   e       This is the Event object that has occurred. 
 *                  This is mainly a hack for Mozilla browsers, in Internet Explorer it is not required.
 *
 * @return  boolean true, if the key is accepted.
 *                  false, if the key is not accepted.
 */
function onlyClear(e){
    var e = e? e : window.event;
    if(!e) 
    return;
    
    var key = 0;
    if (e.keycode) { 
        key = e.keycode; 
    } // for moz/fb, if keycode==0 use 'which'
    else if (typeof(e.which)!= 'undefined') { 
        key = e.which; 
    } 
    //alert(key);
    if ( key==8 || key==0 ){
        return (true) ;
    }
    else{
        return (false); 
    }
}


function clearField(element) {
    if (element.value = '') {
        return true;
    }
    else {
        return false;
    }
}

/**
 * function toggleVisibilityOfElement( element )
 *
 * This function is used to change the visibility of 
 * element, where the "visible" and "hidden" and the 
 * css stylesheet entities having display property 
 * as "block" and "hidden" resp.
 */
function toggleVisibilityOfElement( element ) {
	if ( element.className == "visible" ) {	
		element.className = "hidden";
	}
	else {
		element.className = "visible";
	}
}


function toggleSelection( id ) {
    element = document.getElementById(id)
    if ( count = element.length ) {
        for (i=0; i>count; i++ ) {
            element[i].checked = !element[i].checked;
        }
    }
    
    return (true);
}
// toggleSelection('r_{$id}[]')
function selectAll(parent, parent_div_title, element_name) {
	element = this.window.document.getElementsByName(element_name);
	if ( parent.checked ) {
		boolean = true;
	}
	else {
		boolean = false;
	}
	for ( i=0;i<element.length;i++) {
		if (parent_div_title == element[i].parentNode.title) {
			element[i].checked = boolean;
		}
	}
}

/**
 * This function is used to create the query string format of 
 * all the elements that are present within the scope of the 
 * form that has been passed as an argument.
 *
 * @param	form element	The form for which the query string is to be created.
 *
 * @return	querystring		the querystring format of all the elements is retunred back.
 */

function createQueryString(form) {
	var query_string = "";
	for (var i = 0; i < form.elements.length; i++) {

		switch (form.elements[i].type) {
			case ("text"): {
				if ( form.elements[i].value != "" ) {
					query_string += "&"+ form.elements[i].name +"="+ form.elements[i].value;
				}
				break;
			}
			case ("textarea"): {
				if ( form.elements[i].value != "" ) {
					query_string += "&"+ form.elements[i].name +"="+ form.elements[i].value;
				}
				break;
			}
			case ("hidden"): {
				if ( form.elements[i].value != "" ) {
					query_string += "&"+ form.elements[i].name +"="+ form.elements[i].value;
				}
				break;
			}
			case ("checkbox"): {
				if ( form.elements[i].checked ) {
					query_string += "&"+ form.elements[i].name +"="+ form.elements[i].value;
				}
				break;
			}
			case ("select-one"): {
				query_string += "&"+ form.elements[i].name 
									+"="+ form.elements[i].options[form.elements[i].selectedIndex].value;
				break;
			}
			case ("select-multiple"): {
				s_options = "";
				for ( j=0; j < form.elements[i].length; j++ ) {
					if ( form.elements[i].options[j].selected ) {
						s_options += ","+ form.elements[i].options[j].value;
					}
				}
				if (s_options != "") {
					s_options = s_options.substr(1);
					query_string += "&"+ form.elements[i].name +"="+ s_options;
				}
				break;
			}
			case ("radio"): {
				if ( form.elements[i].checked ) {
					query_string += "&"+ form.elements[i].name +"="+ form.elements[i].value;
				}
				break;
			}
    		case ("submit"): {
				if ( form.elements[i].value != "" ) {
					query_string += "&"+ form.elements[i].name +"="+ form.elements[i].value;
				}
				break;
			}
		}
	}
	return (query_string);
}


function movePage(page,xvar,string_e) {
    var q_string = "?";
    
    
    if ( page != "" && page > 0 ) {
        q_string += "&"+xvar+"="+ page;
       // q_string += "&x="+ page;
    }
    else {
        q_string += "&"+xvar+"=1";
       // q_string += "&x=1";
    }
   
    // extra url variables pass    
    q_string+= string_e ;
    window.location.href = q_string;
    return false;
}

/*
js for left menu BOF 

*/




function toggleVisibilityOfMenu( id ) {
    element = document.getElementById(id);
	if ( element.className == "visible" ) {
		element.className = "hidden";
	}
	else {
		element.className = "visible";
	}
}

function toggleMenu(menuid) {
    element = document.getElementById(menuid);
    var winWh;
    var winW;    
    var winHv;
     var winWvm
    if (parseInt(navigator.appVersion) >3) {
         if (navigator.appName=="Netscape") {
          winW = parseInt(window.innerWidth) ;
          winWh = parseInt(window.innerWidth) -45 ;
          winWv = parseInt(window.innerWidth) - 270;
          winH = parseInt(window.innerHeight) - 40;
          winHS = parseInt(window.innerHeight) - 47;
          winWvm= parseInt(winWv) - 25;
         }
         if (navigator.appName.indexOf("Microsoft")!=-1) {
         
          winW = parseInt(document.body.offsetWidth) - 20;
          winWh = parseInt(winW) - 45;
          winWv = parseInt(winW) - 280;
          winH = parseInt(document.body.offsetHeight)  - 50;
          winHS = parseInt(document.body.offsetHeight)  - 57;
          winWvm= parseInt(winWv) - 40;
         }
    }
    
  
    
    
   	if ( element.className == "visible" ) {
      
        element.className = "hidden";    
        document.getElementById('content01').style.width=winW+"px";
        document.getElementById('content01').style.height=winH+"px";
        document.getElementById('mainId').style.width = winWh+"px";
        document.getElementById('mainId').style.height=winHS+"px";
        document.getElementById('subMainId').style.width=winWh+"px";
        document.getElementById('subMainId').style.height=winHS+"px";       
        document.getElementById('showMenuButton').style.height=winH+"px";
	}
	else {
       
		element.className = "visible";
        document.getElementById('content01').style.width=winWv+"px";       
        document.getElementById('content01').style.height=winH+"px";     
        document.getElementById('mainId').style.width= winWvm+"px";
        document.getElementById('mainId').style.height=winHS+"px";      
        document.getElementById('subMainId').style.width= winWvm+"px";
        document.getElementById('subMainId').style.height=winHS+"px";         
        document.getElementById('showMenuButton').style.height=winH+"px";
        
	}
      
}

function setHtWidth(){

    var winW;
    var winWM;
    var winH;
    var winHS;
    if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
          
            winW = parseInt(window.innerWidth) - 270;
            winWM = parseInt(window.innerWidth) - 300; //For mainId
            winHS = parseInt(window.innerHeight) - 47;
            winH = parseInt(window.innerHeight) - 40;
        }
         
        if (navigator.appName.indexOf("Microsoft")!=-1) {
          
          winW = parseInt(document.body.offsetWidth) - 280;
          winWM = parseInt(document.body.offsetWidth) - 320; //For mainId
          winHS =  parseInt(document.body.offsetHeight) - 57;
          winH =  parseInt(document.body.offsetHeight) - 50;
        }
    }

    
    
    document.getElementById('content01').style.width = winW+"px";       
    document.getElementById('mainId').style.width=winWM+"px";
    document.getElementById('subMainId').style.width=winWM+"px";
    document.getElementById('showMenuButton').style.height=winH+"px";
    
    document.getElementById('content_div').style.height=winH+"px";
    document.getElementById('showMenuButton').style.height=winH+"px";
    document.getElementById('middleId').style.height=winH+"px";
    document.getElementById('content01').style.height=winH+"px";
    document.getElementById('mainId').style.height=winHS+"px";
    document.getElementById('subMainId').style.height=winHS+"px";
    
    
    
}

/*
js for left menu EOF

*/
//To display POPUP window in center bof
function openSmallWindow(url,vwidth,vheight)
{
        if(vwidth=="0") {vwidth=250; }
        if(vheight=="0") {vheight=250; }
        var win_param;	
        LeftPosition = (screen.width) ? (screen.width-vwidth)/2 : 0;
        TopPosition = (screen.height) ? (screen.height-vheight)/2 : 0;       
        win_param="top="+TopPosition+",left="+LeftPosition+",width="+vwidth+",height="+vheight+"channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0,screenX=0,left=75,top=75,screenY=0";
        msgWindow=open(url,"SmallWindow",win_param);
        msgWindow.focus();
        msgWindow.opener= self;
        return false;
}
//To display POPUP window in center eof



/*2009-7-july-21 js For index.html bof*/
var http_send_req;
function toggle() {
	
	if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
            w = parseInt(window.innerWidth) ;
            h = parseInt(window.innerHeight) ;
        }
         
        if (navigator.appName.indexOf("Microsoft")!=-1) {
            w  = parseInt(document.body.offsetWidth) ;
            h  =  parseInt(document.body.offsetHeight) ;
        } 
    }
    
   

	if(document.getElementById('left'))    
	{
         var contentw = w-62 ;
         var icontentw = w-70;
		 document.getElementById('content').style.width = contentw+"px";
		 document.getElementById('inner_content').style.width = icontentw+"px"; 
		 document.getElementById('home_page').style.width =icontentw+"px";
         document.getElementById('menu').style.display = 'none';
		 document.getElementById('arrow_left').src = '../media/images/nc/middle-arrow-right.jpg';
		 document.getElementById('left').id='right';
		 document.getElementById('toggelVal').value='right';
         calltoggel('right');
	}else{
  
         var contentw = w-315 ;
         var icontentw = w-323;
		 document.getElementById('content').style.width =contentw+"px";
		 document.getElementById('inner_content').style.width = icontentw+"px";
		 document.getElementById('home_page').style.width = icontentw+"px";
		 document.getElementById('menu').style.display = 'block';
		 document.getElementById('arrow_left').src = '../media/images/nc/middle-arrow-left.jpg';
		 document.getElementById('right').id='left';
         document.getElementById('toggelVal').value='left';
         calltoggel('left');
	}
}

function calltoggel(tval){
    http_send_req = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_send_req = new XMLHttpRequest();
    }else if (window.ActiveXObject) { // IE
        try {
            http_send_req = new ActiveXObject("Msxml2.XMLHTTP");
        }catch (e) {
            try {
                http_send_req = new ActiveXObject("Microsoft.XMLHTTP");
            }catch (e) {}
        }
    }
    
    if (!http_send_req) {
        return false;
    } 
    var uri = "set-toggel-value.php?tval=" + tval;    
   
    http_send_req.onreadystatechange = setToggelValue;
    http_send_req.open('GET', uri, true);
    http_send_req.send(null);

}
function setToggelValue(){

    if(http_send_req.readyState==4){
   
        if (http_send_req.status == 200){
            var toggelValue = http_send_req.responseText;
            document.getElementById('toggelVal').value= toggelValue.replace(/^\s+|\s+$/g,"");
           
        }
    }

}
/*
function fun1() {
    
    if (parseInt(navigator.appVersion)>3) {
         if (navigator.appName=="Netscape") {
            w = parseInt(window.innerWidth) ;
            h = parseInt(window.innerHeight) ;
            var contentw = w-315 ;
            var contenth = h ;
            var icontentw = w-323;
            document.getElementById('menu').style.height = contenth+"px";
            document.getElementById('arrow').style.height = contenth+"px";
            document.getElementById('content').style.height = contenth+"px";
        }
         
        if (navigator.appName.indexOf("Microsoft")!=-1) {
            w  = parseInt(document.body.offsetWidth) ;
            h  =  parseInt(document.body.offsetHeight) ;
            var contentw = w-315 ;
            var contenth = h ;
            var icontentw = w-323;
            document.getElementById('menu').style.height = "100%";
            document.getElementById('arrow').style.height = "100%";
            document.getElementById('content').style.height = "100%";
        } 
    }
  
   
	document.getElementById('content').style.width = contentw+"px";
	document.getElementById('inner_content').style.display = 'none';
	document.getElementById('inner_content').style.width = icontentw+"px";	

    var displayLanding= document.getElementById('display').value;
    
    if(displayLanding==1){	   
      	var delay = setTimeout("fun2()",3000);	
    }
    
    if(displayLanding==0){
       document.getElementById('home_page').style.display = 'none';
       document.getElementById('inner_content').style.display = 'block';
       document.getElementById('navigation').style.display = 'block';
      
    }
    
}
*/
function fun1() {
    
    
    if (parseInt(navigator.appVersion)>3) {
        if (navigator.appName=="Netscape") {
            w = parseInt(window.innerWidth) ;
            h = parseInt(window.innerHeight) ;
            hm = parseInt(window.innerHeight) - 150 ;
                                                                    
            document.getElementById('menu').style.height = h+"px";
            document.getElementById('menulist').style.height =  hm+"px";
            document.getElementById('arrow').style.height = h+"px";
            document.getElementById('content').style.height = h+"px";           
        }
         
        if (navigator.appName.indexOf("Microsoft")!=-1) {
            w  = parseInt(document.body.offsetWidth) ;
            h  =  parseInt(document.body.offsetHeight) ;
            
            document.getElementById('menu').style.height = "100%";
            document.getElementById('menulist').style.height = "96%";
            document.getElementById('arrow').style.height = "100%";
            document.getElementById('content').style.height = "100%";
            
        } 
    }
  
    var displayLanding= document.getElementById('display').value;
    /*
    if(displayLanding==1){   
      	var delay = setTimeout("fun2()",3000);	
    }
    
    if(displayLanding==0){
       document.getElementById('home_page').style.display = 'none';
       document.getElementById('inner_content').style.display = 'block';
       document.getElementById('navigation').style.display = 'block';
      
    }*/
    
    
    if(document.getElementById('toggelVal').value=='left')    
	{
        var contentw = w-315 ;
         var icontentw = w-323;
		 document.getElementById('content').style.width =contentw+"px";
		 document.getElementById('inner_content').style.width = icontentw+"px";
		 //document.getElementById('home_page').style.width = icontentw+"px";
		 document.getElementById('menu').style.display = 'block';
         document.getElementById('arrow_left').src = '../media/images/nc/middle-arrow-left.jpg';
		 //document.getElementById('right').id='left';
         document.getElementById('toggelVal').value='left';
         calltoggel('left');
         
	}else{
         
         var contentw = w-62 ;
         var icontentw = w-70;
		 document.getElementById('content').style.width = contentw+"px";
		 document.getElementById('inner_content').style.width = icontentw+"px"; 
		// document.getElementById('home_page').style.width =icontentw+"px";
         document.getElementById('menu').style.display = 'none';
         document.getElementById('arrow_left').src = '../media/images/nc/middle-arrow-right.jpg';
		 document.getElementById('left').id='right';
		 document.getElementById('toggelVal').value='right';         
          calltoggel('right');
	}
    
}

function fun2() {

	document.getElementById('home_page').style.display = 'none';
	document.getElementById('inner_content').style.display = 'block';
    document.getElementById('navigation').style.display = 'block';
    //document.getElementById('navigation').style.display = 'block';
}

function cleanState(id) {
	var state;	
	state = document.getElementById(id);	
	
	if (state.value == "First Name" || state.value == "Last Name" || state.value == "Company" || state.value == "Address" || state.value == "City" || state.value == "State" ||  state.value == "Mobile" || state.value == "Phone" || state.value == "Email" || state.value == "Comments" || state.value == "Verify")
    {	  	  	
        state.value = "";
        state.style.color = "#3a3737";
	    state.style.fontWeight = "bold";
    }
}

function changeState(id) {
	var state;	
	state = document.getElementById(id);	
	
    state.style.color = "#3a3737";
	state.style.fontWeight = "bold";
    
    if(id == 'first_name_id'){
        if(!(state.value))
        {
            state.value = "First Name";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    
    if(id == 'last_name_id'){
        if(!(state.value))
        {
            state.value = "Last Name";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    
    if(id == 'firm'){
        if(!(state.value))
        {
            state.value = "Company";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    
    if(id == 'address'){
        if(!(state.value))
        {
            state.value = "Address";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    
    if(id == 'city'){
        if(!(state.value))
        {
            state.value = "City";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    
    if(id == 'state'){
        if(!(state.value))
        {
            state.value = "State";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    if(id == 'mobile'){
        if(!(state.value))
        {
            state.value = "Mobile";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    if(id == 'contact_no'){
        if(!(state.value))
        {
            state.value = "Phone";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    
    if(id == 'email'){
        if(!(state.value))
        {
            state.value = "Email";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    
    if(id == 'comments'){
        if(!(state.value))
        {
            state.value = "Comments";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    if(id == 'salutation'){
        if(!(state.value))
        {
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    if(id == 'country'){
        if(!(state.value))
        {
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
    if(id == 'calculate'){
        if(!(state.value))
        {
            state.value = "Verify";
            state.style.color = "#989494";
	        state.style.fontWeight = "normal";
        }
    }
}
/*2009-7-july-21 js For index.html eof*/

