//Contents for Solutions menu (menu 1)
var menu1=new Array()
menu1[0]='<A title="Admission" href="admission.html">Admission</A>'
menu1[1]='<A title="International Students" href="international-students.html" onMouseover="dropdownmenu_submenu(this, event, menu1a)" onMouseout="delayhidemenu_submenu()">International Students</A>'
menu1[2]='<A title="Local Students" href="local-students.html" onMouseover="dropdownmenu_submenu(this, event, menu1b)" onMouseout="delayhidemenu_submenu()">Local Students</A>'

//Contents for Enterprise Software Solutions sub-menu (menu 1a)

var menu1a=new Array()
menu1a[0]='<A title="Horticulture" href="courses-horticulture.html">Horticulture</A>'


//Contents for Security Services sub-menu (menu 1b)
var menu1b=new Array()
//menu1b[0]='<A title="TAA" href="courses-training.html">TAA</A>'
menu1b[0]='<A title="Horticulture" href="courses-horticulture.html">Horticulture</A>'


//Contents for Clients menu (menu 2)
var menu2=new Array()		
menu2[0]='<A title="ICT Policies & Procedures" href="Policies.html" >ICT International Policies and Procedures</A>'
menu2[1]='<A title="Students" href="Students.html" onMouseover="dropdownmenu_submenu(this, event, menu2a)" onMouseout="delayhidemenu_submenu()">Students</A>'

menu2[2]='<A title="Agents" href="Agents.html" onMouseover="dropdownmenu_submenu(this, event, menu2c)" onMouseout="delayhidemenu_submenu()">Agents</A>'




var menu2a=new Array()		
menu2a[0]='<A title="Pre-departure" href="Pre-departure.html">Pre-departure</A>'
menu2a[1]='<A title="Post arrival" href="Post-arrival.html">Post arrival</A>'
menu2a[2]='<A title="During the course" href="During-the-course.html">During the course</A>'
menu2a[4]='<A title="Student Login" href="Student-Logind.html">Student Login</A>'
menu2a[5]='<A title="Student Email" href="Student-Email.html">Student Email</A>'
//menu2a[6]='<A title="Student Handbook and Forms" href="Student-forms.html">Student Handbook and Forms</A>'



var menu2c=new Array()		
menu2c[0]='<A title="Agents login" href="AgentsMap.html">List of Agents</A>'


//Contents for Contract Vehicles menu (menu 3)
var menu3=new Array()		
menu3[0]='<A title="About Adelaide" href="About-Adelaide.html">About Adelaide</A>'
menu3[1]='<A title="Living in Australia" href="About-Australia.html">Living in Australia</A>'
menu3[2]='<A title="Cost of living" href="Cost-of-living.html">Cost of living</A>'

//Contents for Corporate menu (menu 4)
var menu4=new Array()
//menu4[1]='<A title="Leadership" href="/corporate/leadership.asp">Leadership</A>'
menu4[0]='<A title="Individual seeking jobs" href="individual-seeking-jobs.php">Individual seeking jobs</A>'

//Contents for Careers menu (menu 5)

var menu5=new Array()		
menu5[0]='<A title="ESOS Act and National code" href="useful-info.html">ESOS Act and National code</A>'
menu5[1]='<A title="Overseas Students Tution Assurance Scheme(OSTAS)" href="OSTAS.html">OSTAS </A>'
menu5[2]='<A title="Useful Links" href="Useful-Links.html">Useful Links</A>'
menu5[3]='<A title="FAQs" href="FAQs.html">FAQs</A>'

var menu6=new Array()		
menu6[0]='<A title="All Forms" href="all_forms.html">All Forms</A>'

var menu7=new Array()		
//menu7[0]='<A title="News" href="#">News</A>'
menu7[0]='<A title="Events" href="events.php">Events</A>'

var menuwidth='180px' //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, '');
}
