shad=new Array ("/img/m1.gif","/img/m1_.gif","/img/m1a.gif","/img/m2.gif","/img/m2_.gif","/img/m2a.gif","/img/m3.gif","/img/m3_.gif","/img/m3a.gif","/img/m4.gif","/img/m4_.gif","/img/m4a.gif","/img/m5.gif","/img/m5_.gif","/img/m5a.gif","/img/m6.gif","/img/m6_.gif","/img/m6a.gif")

function menu()
{
	var Images=new Array();
	for (var i=0; i<shad.length; i++)
	{
		Images[i]=new Image();
		Images[i].src=shad[i];
	};

};

window.onload=function(){menu();};

var Bright = 'hlight';
var Default= 'input';



function hl(el, style){el.className = style;}


function notEmpty(elem, err) 
{
    var str = elem.value;

    if(str == null || str.length == 0 ||str == 'Your enquiry') 
	{
		hl(elem, Bright);
		errorString+=err; 
		return false;
	}
	else 
	{
		hl(elem,Default);
		return true;
	}
}


function validEmail(elem, err)
{
    if(elem.value.length > 0)
	{
		var str = elem.value;
	    var splitted = str.match("^(.+)@(.+)$");

	    if(splitted !== null && splitted[1] !== null)
		{
	    	var regexp_user=/^\"?[\w-_\.]*\"?$/;
		    if(splitted[1].match(regexp_user) !== null && splitted[2] !== null)
			{
		    	var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
				var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
				if((splitted[2].match(regexp_domain) !== null) || (splitted[2].match(regexp_ip) !== null))
				{
					hl(elem,Default);
					return true;
				}
			}
		
		}
	}
	hl(elem, Bright);
	errorString+=err;
	return false;
}


function notSelected(elem, err, ind) 
{
    var str = elem.selectedIndex;

    if(str==ind) 
	{
		hl(elem, Bright);
		errorString+=err; 
		return false;
	}
	else 
	{
		hl(elem,Default);
		return true;
	}
}

function validateForm(formname)
{
	errorString = "Please fill in following fields:     \n-------------------------------\n";

	var Results = [
	notEmpty(formname.fname, 'First name \n'),
	notEmpty(formname.lname, 'Last name \n'),
	notEmpty(formname.company, 'Company \n'),
//	notEmpty(formname.town, 'Town / city \n'),
	notEmpty(formname.country, 'Country \n'),
	validEmail(formname.email, 'Email (should be valid)\n'),
	notEmpty(formname.phone, 'Phone \n')
//	notEmpty(formname.enquiry, 'Your enquiry \n')
	];

	if (Results[0] && Results[1] && Results[2] && Results[3] && Results[4] && Results[5]/* && Results[6] && Results[7]*/)
	{
		return true;
	}
	else
	{
		alert(errorString);
		return false;
	}
}
function popup(what)
{
     wopt="scrollbars=no,status=no,toolbar=no,menubar=no,resizable=yes,width=700,height=500,screenX=50,screenY=50";
     newpop=window.open(what,"image",wopt);
     newpop.document.open();
     newpop.document.write('<html><head><title>Image</title><link href="/inc/site/popup.css" rel="stylesheet"></head>');
     wobo="this.resizeTo(document.getElementsByTagName('IMG').item(0).width+14,document.getElementsByTagName('IMG').item(0).height+33)";
     newpop.document.write('<body class="gPopup" onload="'+wobo+'"><table cellspacing="0" cellpadding="0"><tr><td><img src="http://www.catalystglobal.com/our_events/img/'+what+'.jpg" alt=""></td></tr></table></body></html>');
     newpop.document.close();
	 if (window.focus) {newpop.focus()}
}
function popit(what)
{
     wopt="scrollbars=no,status=no,toolbar=no,menubar=no,resizable=yes,width=530,height=530,screenX=50,screenY=50";
     newpop=window.open(what,"image",wopt);
     newpop.document.open();
     newpop.document.write('<html><head><title>Image</title><link href="/inc/site/popup.css" rel="stylesheet"></head>');
     wobo="this.resizeTo(document.getElementsByTagName('IMG').item(0).width+14,document.getElementsByTagName('IMG').item(0).height+33)";
     newpop.document.write('<body class="gPopup" onload="'+wobo+'"><table cellspacing="0" cellpadding="0"><tr><td><img src="images/'+what+'l.jpg" alt=""></td></tr></table></body></html>');
     newpop.document.close();
	 if (window.focus) {newpop.focus()}
}
function popwin(src){
	nw= window.open(src,"POP","width=500,height=320,scrollbars=auto,menubar=no,status=no,resizable=yes");
	if (window.focus) {nw.focus()}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
// flash loading fix for internet explorer
var bo_ns_id = 0;
function startIeFix(){
	if(isIE()){
		document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
		}
	}
function endIeFix(){
	if(isIE()){
		document.write('</div>');
		var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
		var theCode = theObject.innerHTML;
		theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
		document.write(theCode);
		}
	}
function isIE(){  
// only for Win IE 6+  
// But not in Windows 98, Me, NT 4.0, 2000
var strBrwsr= navigator.userAgent.toLowerCase();
	if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
		if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
			return false;
		}
	if(strBrwsr.indexOf("win98") > -1 ||
		strBrwsr.indexOf("win 9x 4.90") > -1 ||
		strBrwsr.indexOf("winnt4.0") > -1 ||
		strBrwsr.indexOf("windows nt 5.0") > -1)    {
		return false;
		}
		return true;
		}else{
			return false;
		}
}
function poppdf(url)
{
	newwindow=window.open(url,'name','height=600,width=500,resizable=1');
	if (window.focus) {newwindow.focus()}
}
