
//Contents for About PEC menu (menu 1)
var menu1=new Array()
menu1[0]='<A title="Headquarters" href="headquarters.html">Headquarters</A>'
menu1[1]='<A title="Our Mission" href="mission.html">Our Mission</A>'
menu1[2]='<A title="Milestones" href="milestone.html">Milestones</A>'
menu1[3]='<A title="Installations" href="installations.html">Installations</A>'
menu1[4]='<A title="Directions to PEC" href="directions.html">Directions to PEC</A>'

//Contents for Products menu (menu 2)
var menu2=new Array()		
menu2[0]='<A title="Insight IVR" href="insightivr.html">Insight IVR</A>'
menu2[1]='<A title="Insight IVR XML" href="ivrxml.html">Insight IVR XML</A>'
menu2[2]='<A title="Quintum VoIP Gateways" href="quintum.html">Quintum VoIP Gateways</A>'

//Contents for Services menu (menu 3)
var menu3=new Array()		
menu3[0]='<A title="Custom IVR Development" href="CustomIVR.html">Custom IVR Development</A>'
menu3[1]='<A title="Hosted IVR Services" href="HostedIVR.html">Hosted IVR Services</A>'

//Contents for Support menu (menu 4)
var menu4=new Array()
menu4[0]='<A title="Downloads" href="download.html">Downloads</A>'
menu4[1]='<A title="Documentation" href="documentation.html">Documentation</A>'
menu4[2]='<A title="Contact Us" href="contactus.html">Contact Us</A>'

var menuwidth='160px' //default menu width
var menubgcolor=''  //menu bgcolor
var disappeardelay=50  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
var hidemenu_onclick_submenu="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
{
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>');
document.write('<div id="dropmenudiv_submenu" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu_submenu()" onMouseout="dynamichide_submenu(event)"></div>');
}

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500;
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style;

if (navigator.appName=="Netscape")
{
	dropmenuobj.widthobj.width=200;
	}
else
	{
	dropmenuobj.widthobj.width=200;
		}
//alert (menu1[0].length);
//alert (menu1[2].length);
//alert (menu1[3].length);
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible;

else if (e.type=="click")
obj.visibility=hidden;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-15
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents)
{

	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	clearhidemenu()
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
	populatemenu(menucontents);
	if (ie4||ns6)
	{
		//alert(getposOffset(obj, "width"));
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
		//dropmenuobj.x=getposOffset(obj, "width");
		//dropmenuobj.x=288;
		dropmenuobj.x=getposOffset(obj, "left");
		dropmenuobj.y=getposOffset(obj, "top")
		//alert(getposOffset(obj, "top"));
		dropmenuobj.style.left=(dropmenuobj.x+1)+"px"
		//dropmenuobj.style.left="400px"
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "TOP")+(obj.offsetHeight-2)+"px"
		
	}
	
	return clickreturnvalue()
}


function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined")
{
if (ie4||ns6)
{
//alert(dropmenuobj_submenu.style.visibility)
if (typeof dropmenuobj_submenu!="undefined")
{
	if (dropmenuobj_submenu.style.visibility!="visible")
	{
		dropmenuobj.style.visibility="hidden"
	}
}
else
{
		dropmenuobj.style.visibility="hidden"
	}
}
}
}

function delayhidemenu(){
			//alert("inside");
			if (ie4||ns6)
			delayhide=setTimeout("hidemenu()",disappeardelay)	

}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu


///////
//////
//////




function getposOffset_submenu(what, offsettype){
var totaloffset_submenu=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl_submenu=what.offsetParent;
while (parentEl_submenu!=null){
totaloffset_submenu=(offsettype=="left")? totaloffset_submenu+parentEl_submenu.offsetLeft : totaloffset_submenu+parentEl_submenu.offsetTop;
parentEl_submenu=parentEl_submenu.offsetParent;
}
return totaloffset_submenu;
}


function showhide_submenu(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj_submenu.style.left=dropmenuobj_submenu.style.top=-500;
if (menuwidth!=""){
dropmenuobj_submenu.widthobj=dropmenuobj_submenu.style;
dropmenuobj_submenu.widthobj.width=160;
//alert (menu1[0].length);
//alert (menu1[2].length);
//alert (menu1[3].length);
}
dropmenuobj.style.visibility=visible;
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible;

else if (e.type=="click")
obj.visibility=hidden;
}

function iecompattest_submenu(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge_submenu(obj, whichedge){
var edgeoffset_submenu=0
if (whichedge=="rightedge"){
var windowedge_submenu=ie4 && !window.opera? iecompattest_submenu().scrollLeft+iecompattest_submenu().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj_submenu.contentmeasure=dropmenuobj_submenu.offsetWidth
if (windowedge_submenu-dropmenuobj_submenu.x < dropmenuobj_submenu.contentmeasure)
edgeoffset_submenu=dropmenuobj_submenu.contentmeasure-obj.offsetWidth
}
else{
var topedge_submenu=ie4 && !window.opera? iecompattest_submenu().scrollTop : window.pageYOffset
var windowedge_submenu=ie4 && !window.opera? iecompattest_submenu().scrollTop+iecompattest_submenu().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj_submenu.contentmeasure=dropmenuobj_submenu.offsetHeight
if (windowedge_submenu-dropmenuobj_submenu.y < dropmenuobj_submenu.contentmeasure){ //move up?
edgeoffset_submenu=dropmenuobj_submenu.contentmeasure+obj.offsetHeight
if ((dropmenuobj_submenu.y-topedge)<dropmenuobj_submenu.contentmeasure) //up no good either?
edgeoffset_submenu=dropmenuobj_submenu.y+obj.offsetHeight-topedge
}
}
return edgeoffset_submenu
}

function populatemenu_submenu(what){
if (ie4||ns6)
dropmenuobj_submenu.innerHTML=what.join("")
}

function dropdownmenu_submenu(obj, e, menucontents)
{

	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	clearhidemenu_submenu()
	dropmenuobj_submenu=document.getElementById? document.getElementById("dropmenudiv_submenu") : dropmenudiv_submenu
	populatemenu_submenu(menucontents);
	if (ie4||ns6)
	{
		dropmenuobj.style.visibility="visible";
		//alert(getposOffset_submenu(obj, "width"));
		showhide_submenu(dropmenuobj_submenu.style, e, "visible", "hidden", menuwidth)
		//dropmenuobj_submenu.x=getposOffset_submenu(obj, "width");
		//dropmenuobj_submenu.x=288;
		dropmenuobj_submenu.x=getposOffset_submenu(obj, "left")+140;
		//alert(dropmenuobj_submenu.x);
		dropmenuobj_submenu.y=getposOffset_submenu(obj, "top");
		//alert(getposOffset_submenu(obj, "top"));
		dropmenuobj_submenu.style.left=dropmenuobj_submenu.x+"px"
		//dropmenuobj_submenu.style.left="400px"
		dropmenuobj_submenu.style.top=dropmenuobj_submenu.y-clearbrowseredge_submenu(obj, "TOP")+"px";
		//dropmenuobj_submenu.style.left="500px";
		//dropmenuobj_submenu.style.top="400px";
	}
	
	return clickreturnvalue_submenu()
}

function clickreturnvalue_submenu(){
if (ie4||ns6) return false
else return true
}

function contains_ns6_submenu(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide_submenu(e){
if (ie4&&!dropmenuobj_submenu.contains(e.toElement))
delayhidemenu_submenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu_submenu()
}

function hidemenu_submenu(e){
if (typeof dropmenuobj_submenu!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
dropmenuobj_submenu.style.visibility="hidden"

}
}

function delayhidemenu_submenu(){
if (ie4||ns6)
delayhide_submenu=setTimeout("hidemenu_submenu()",disappeardelay)
}

function clearhidemenu_submenu(){
if (typeof delayhide_submenu!="undefined")
clearTimeout(delayhide_submenu)
}

if (hidemenu_onclick_submenu=="yes")
document.onclick=hidemenu_submenu



function changeimage(imgx,placex) {
  if (document.images) {
    document.images[placex].src = eval(imgx + ".src");
  }
}
/*
Step 3: Modify the A HREF tag (which makes the image act as a link) to include an onMouseOver instruction (using the function from Step 2 above) and an onMouseOut instruction, also using the function.
<a href="index.htm"
  onMouseOver="changeimage('img4','daisy');"
  onMouseOut="changeimage('img2','daisy');"><img   src="images/indexbutton.gif"
  name="daisy" alt="JavaScripts Index" width="153" height="120"   border="0"></a>
  */
  
  function col_normal(colName,colHeadingName)
  {
  colName.className='Normal';
  document.getElementById(colHeadingName).className='NormalHeading';
  }
  
  function col_highlight(colName,colHeadingName)
  {
  colName.className='Highlight';
  document.getElementById(colHeadingName).className='HighlightHeading';
  }
  
  function verifySearch()
  {
	  if (document.getElementById("searchText").value != "")
	  {
		  //alert("document.getElementById(hdn_searchSite)" + document.getElementById("hdn_searchSite").value);
		  	if  (document.getElementById("searchText").value == "Search")
		  	{
			  var blnSearch=confirm("You are trying to search for the keyword \"Search\"." +"\n"+"Do You want to Continue?");
			  if (blnSearch==true)
				{
					searchTheSite();
				}
			}
			else
			{
				searchTheSite();
			}
	  }

	  else
	  	{
			alert("Please enter at least one keyword to search");
			document.frmSiteSearch.search.focus();
		}

  }
  
  function searchTheSite()
  {
	  if(CheckForm ())
	  {
	  
		  if (document.getElementById("hdn_searchSite").value == "www")
		  {
		   document.getElementById("frmSiteSearch").method="Get";
		   document.getElementById("rb_searchSite").name="domains";
		   document.getElementById("searchText").name="q";
		   
			  document.getElementById("frmSiteSearch").action="http://www.google.com/search";
			  document.getElementById("frmSiteSearch").submit();
		  }
		  else if (document.getElementById("hdn_searchSite").value == "www.qssinc.net")
		  {
		   document.getElementById("frmSiteSearch").method="Post";
		  //alert("Before  :  " + document.getElementById("frmSiteSearch").action);
			  document.getElementById("frmSiteSearch").action="/search.asp?searchText="+document.getElementById('searchText').value + "&submit=Search+%3E%3E&mode="+document.getElementById('hdn_searchType').value;
		  //alert("After  :   " + document.getElementById("frmSiteSearch").action);
			  
			  document.getElementById("frmSiteSearch").submit();
		  }
	  }
  }
  //Check the form before submitting
function CheckForm () 
{

	//Check for a word to search
		//alert(document.getElementById("searchText").value);
		
	if ((trimString(document.getElementById("searchText").value)).length  != 0)
	{
				if  ((document.getElementById("searchText").value == "Search in qssinc.net") || (document.getElementById("searchText").value == "Search the WWW"))
				{
				  var blnSearch=confirm("You are trying to search for the keyword:\n \n \'"+document.getElementById("searchText").value +"\'\n\n"+"Do You want to Continue?");
				  if (blnSearch==true)
					{
						return true;
					}
				}
				else
				{
					return true;
				}
	}
	else
	{
		alert("Please enter a keyword to search.");
		return false;
	}
}


function trimString (str) {
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}


