
function open_win(win)
{
window.open(win,"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=yes, width=400, height=400")
}

var newwindow = ''
function newWindow(url,arg1,arg2) {
//args are not used, but are there for tinyMCE onclick event
if (newwindow.location && !newwindow.closed) {
    newwindow.location.href = url;
    newwindow.focus(); }
else {
    newwindow=window.open(url,'htmlname','width=500,height=400,resizable=1,scrollbars = yes');
		
		}
return false;
}

//Change style in mouse over
function mouseIn(ele){ 
 chgStyle(ele,'#000000','#3399ff') 
}
//change style on mouse out
function mouseOut(ele){
 chgStyle(ele,'#ffffff','#000099')
}
//Change style in mouse over
function mouseInSub(ele){ 
 chgStyle(ele,'#ffffff','#6E70DD') 
}
//change style on mouse out
function mouseOutSub(ele){
 chgStyle(ele,'#000000','#AAAAD4')
}


//Change the text colour and background colour of an element - note that the style 
//properties are javascript- not CSS
		function chgStyle(element,col,bgcol){  		 
		 if(document.getElementById){
		 try{ 	     
		  document.getElementById(element).style.color = col;
		//	document.getElementById(element).style.backgroundColor = bgcol;
			//document.getElementById(element).style.borderBottomColor = bgcol;
			
			
			
			}
			catch(e){alert("error is : " +e)}
		 }
		}

 

function showmenu(elmnt)
{
hidemenu()
if(elmnt!==""){
    var v_regexp = new RegExp(elmnt,"gi")
    for ( var i = 0; i < submenus.length; i++ ) {
         if ( v_regexp.test(submenus[i]) ) {
               // Pattern found
    					
             document.getElementById(submenudiv).style.display="block"
						 document.getElementById(elmnt).style.color="#87C3FF";
						 
						 for (i=0;i<elms_with_submenu.length;i++)
                {		
            		 j =  elms_with_submenu[i] 		
            		 
            		 var x= document.getElementById(j).getElementsByTagName("a")
            		 for (var i=0;i<x.length;i++)
                  { 
                    x[i].style.color="#87C3FF"
                  }
            		}
						 
         }
    }
}
document.getElementById(elmnt).style.display="block"
/**/	

}//end function 

//Hide an element
function hidemenu()
{
  for (i=0;i<submenus.length;i++)
    {		
		 j =  submenus[i] 			
		 document.getElementById(j).style.display="none"
    }  
	document.getElementById(submenudiv).style.display="none" 	
	 for (i=0;i<elms_with_submenu.length;i++)
                {		
            		 j =  elms_with_submenu[i] 		
            		 
            		 var x= document.getElementById(j).getElementsByTagName("a")
            		 for (var i=0;i<x.length;i++)
                  { 
                    x[i].style.color="#ffffff"
                  }
            		}
}

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 == '');
}


//Advanced Email Check credit-
//By JavaScript Kit (http://www.javascriptkit.com)
//Over 200+ free scripts here!

var testresults
function checkemail(){
var str=document.fregister.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}


