// JavaScript Document
function MM_jumpMenuGo(objId,targ,restore){ //v9.0
  var selObj = null;  with (document) { 
  if (getElementById) selObj = getElementById(objId);
  if (selObj) eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0; }
}
/* Layer display on Header section*/
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
/*Email Queries form check start*/
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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
/*Email Queries form check ends*/

/* Print page - Function*/
function printPage()
{
	if (!window.print)
	{
		alert("You need NS4.x to use this print button!")
		return
	}
	window.print()
}

/* Add to favorites - Function*/
function addFavorite()
{
	window.external.AddFavorite('http://www.futurenettechnologies.com','FutureNet Technologies IT Solutions-Web Hosting & Designing');
	window.status = 'message';
	return true;
}

/* Status bar message - Function*/
function statusMsg(message){
window.status = message;
return true;
}

/* Global File include Function*/
document.include = function (url){
	if ('undefined' == typeof(url)) return false;
	var p,rnd;
	if (document.all)
	{
	   // For IE, create an ActiveX Object instance
	   p = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else 
	{
	   // For mozilla, create an instance of XMLHttpRequest.
	   p = new XMLHttpRequest();
	}
	// Prevent browsers from caching the included page
	// by appending a random  number
	rnd = Math.random().toString().substring(2);
	url = url.indexOf('?')>-1 ? url+'&rnd='+rnd : url+'?rnd='+rnd;
	// Open the url and write out the response
	p.open("GET",url,false);
	p.send(null);
	document.write( p.responseText );
}

function openWindow(w,h,url,scrl){  	
  	var leftPos = (screen.width/2) - (w/2);
	var topPos = (screen.height/2) - (h/2);
	
	winStats='width='+w+',height='+h+',top='+topPos+',left='+leftPos+',toolbar=no,location=no,directories=no,status=no,resize=no,menubar=no,scrollbars='+scrl+'';
	window.open(url,"pop",winStats).focus();
}

/*Dynamic Font Size*/
function changeFont(divID, dynFtSize){
	document.getElementById(divID).className=dynFtSize;
}

/*Selected Left Navigation*/
var lastMenuCheck = "aboutus";
function selectedNav(menuClick){
	document.getElementById(lastMenuCheck).className = "txtNormal";
    document.getElementById(menuClick).className = "txtBold";
    lastMenuCheck = document.getElementById(menuClick).id;
}
function showHideAltDiv(divHideObj){/*Homepage content show hide*/
	var divObj=document.getElementById('contentShowHide').getElementsByTagName('DIV');
	var divObjLen=divObj.length;
	for (i=0;i<divObjLen;i++)
	{
		x=++i;
		divObj[x].style.display='none';
	}
		document.getElementById(divHideObj).style.display='block';
}
function faq(liDivObj){
	var divObj=document.getElementById('bodyText').getElementsByTagName('DIV')
	var divObjLen=document.getElementById('bodyText').getElementsByTagName('DIV').length;
	for(i=0;i<divObjLen;i++)
	{
		divObj[i].style.display='none';		
	}
	document.getElementById(liDivObj).style.display='block';	
}
function changeURL(){
	var objHref=location.href;
	var queryString = objHref.split('?');
	if(queryString[2]=="Ebook")
	{
		document.getElementById('prodLink').setAttribute('href', "Downloads/Ebooks/"+queryString[1]+".zip");
		document.getElementById('showDonatePanel').style.display="";
	}
	else if(queryString[2]=="Software")
	{
		document.getElementById('prodLink').setAttribute('href', "Downloads/Softwares/"+queryString[1]+".zip");
		document.getElementById('showDonatePanel').style.display="";
	}	
}

/* JQUERY FUNCTION STARTS*/
$(document).ready(function(){
	$('#accordion h3').click(function() {//function for hompage Accordian
		$('#accordion div').hide('medium');
		$(this).next().toggle('medium');
		//.next().hide();
	})
	$('#gallery a.lightbox').click(function(){
		$('#gallery a.lightbox').lightBox();//function for clientele gallary							   
	});	
});




/* JQUERY FUNCTION ENDS */
