// FLASH FUNCTION START HERE----------------------------------------------------------/
function commitFlashObject(_obj, _container){
	_output=""
	_paramoutput=""
	_src=""
	_ver=""
	for(_cO in _obj){
		_output+=_cO+"=\""+_obj[_cO]+"\" "
		_paramoutput+="<param name="+_cO+" value=\""+_obj[_cO]+"\">";
		if(_cO=="movie")_src="src=\""+_obj[_cO]+"\"";
		if(_cO=="version")_ver=_obj[_cO];
	}
	if(_ver=="")_ver="8,0,0,0"
	ihtm="<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+_ver+" "+_output+">\n"
	ihtm+=_paramoutput+"\n"
	ihtm+="<embed "+_src+" pluginspage=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash type=application/x-shockwave-flash "+_output+">\n";
	ihtm+="</embed>\n";
	ihtm+="</object>\n";
	document.getElementById(_container).innerHTML=ihtm	
}







function getFlashMovieObject(movieName) 
{
    if (window.document[movieName]) 
    {   return window.document[movieName];
    }
    if (navigator.appName.indexOf("Microsoft Internet") == -1) 
    {   if (document.embeds && document.embeds[movieName]) 
    	{ return document.embeds[movieName];
     	}
    } 
    else 
    {   return document.getElementById(movieName);
    }
}
// FLASH FUNCTION END HERE----------------------------------------------------------/












// FLASH SLIMBOX FUNCTION START HERE----------------------------------------------------------/
function galleryDisplayImage(strImage, strText) 
{Slimbox.open(strImage, strText, {overlayOpacity: 0.7});
}
// FLASH SLIMBOX FUNCTION END HERE----------------------------------------------------------/






// FORM AUTO CLEAR FUNCTION START HERE----------------------------------------------------------/
//BlurEvents();
/*function resetFields(whichform) {
  for (var i=0; i<whichform.elements.length; i++) {
    var element = whichform.elements[i];
    if (element.type == "submit") continue;
    if (!element.defaultValue) continue;
    element.onfocus = function() {
    if (this.value == this.defaultValue) {
      this.value = "";
     }
    }
    element.onblur = function() {
      if (this.value == "") {
        this.value = this.defaultValue;
      }
    }
  }
}*/
function searchClear(element) {
	if(document.getElementById("search").value == "search here") {
		document.getElementById("search").value = "";
	}
}
function searchDisplay() {
	if(document.getElementById("search").value == "") {
		document.getElementById("search").value = "search here";
	}
}
// FORM AUTO CLEAR FUNCTION START HERE----------------------------------------------------------/



// LOGIN FUNCTION START HERE----------------------------------------------------------/
function login_display() {
	//alert("login");
	if(document.getElementById("login_div").style.display == "none") {
		document.getElementById("login_div").style.display = "block";
		document.getElementById("login_fade").style.display = "block";
   } else {
		document.getElementById("login_div").style.display = "none";
		document.getElementById("login_fade").style.display = "none";
		
   }
}
// LOGIN FUNCTION START HERE----------------------------------------------------------/



// VALIDATION FUNCTION START HERE----------------------------------------------------------/
function direct_inquiry()
{
	if (document.W4U_Enquiry.form_name.value == "Name")
	{	alert("Please enter your Name.");
		document.W4U_Enquiry.form_name.focus();
	return false;}
	
	
	else if (document.W4U_Enquiry.form_surname.value == "Surname")
	{	alert("Please enter your Surname.");
		document.W4U_Enquiry.form_surname.focus();
	return false;}
	
	
	else if (document.W4U_Enquiry.form_email.value == "Email")
	{	alert("Please enter your Email Address.");
		document.W4U_Enquiry.form_email.focus();
	return false;}
	
	
	
	
		
	else
	{
	document.W4U_Enquiry.form_url.value = location;
	document.W4U_Enquiry.action = document.W4U_Enquiry.form_mail.value;
	document.W4U_Enquiry.submit();
	}	
}
// -------------------------------------------------------------------------------------/



// DISPLAY TAB FUNCTION START HERE----------------------------------------------------------/

function fadeOut(id) {
	var obj = document.getElementById(id);
	var current = obj.style.opacity*100;
	var step = 10;
	if (current > 0) {
		if (current - step < 0) {
			current = 0;	
		}
		else {
			current -= step;	
		}
		
		obj.style.filter = "alpha(opacity="+current+")";
		obj.style.opacity = current/100;
		
		fadeTimer = setTimeout ("fadeOut('"+id+"')", 20);
		
	}
	else {
		//done	
	}
}

function fadeIn(id) {
	var obj = document.getElementById(id);
	var current = obj.style.opacity*100;
	var step = 10;
	if (current < 100) {
		if (current + step > 100) {
			current = 100;	
		}
		else {
			current += step;	
		}
		
		obj.style.filter = "alpha(opacity="+current+")";
		obj.style.opacity = current/100;
		
		fadeTimer = setTimeout ("fadeIn('"+id+"')", 20);
		
	}
	else {
		//done	
	}
}


function displayDetails(num,maxNum) {
	if(document.getElementById("details"+num).style.display == "none") {
		for(var i = 1; i <= maxNum; i++) {
			if(num == i) {
				document.getElementById("details"+i).style.filter = "alpha(opacity=0)";
				document.getElementById("details"+i).style.opacity = "0.0";
				document.getElementById("details"+i).style.display = "block";
				fadeIn("details"+i);
				
				document.getElementById("left"+i).style.background = "url(images/login/tab1_left.jpg)";
				document.getElementById("bg"+i).style.background = "url(images/login/tab1_bg.jpg) repeat-x";
				document.getElementById("right"+i).style.background = "url(images/login/tab1_right.jpg)";
				document.getElementById("bg"+i).style.color = "#ffffff";
			} else {
				document.getElementById("details"+i).style.display = "none";
				document.getElementById("left"+i).style.background = "url(images/login/tab2_left.jpg)";
				document.getElementById("bg"+i).style.background = "url(images/login/tab2_bg.jpg) repeat-x";
				document.getElementById("right"+i).style.background = "url(images/login/tab2_right.jpg)";
				document.getElementById("bg"+i).style.color = "#575757";
			}
		}

	}
}
// DISPLAY TAB FUNCTION END HERE----------------------------------------------------------/




/***********************************************
* Bookmark site script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* Modified to support Opera */
function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}





// DISPLAY BANNER FUNCTION START HERE----------------------------------------------------------/
function changeBanner(n) {
	if(n ==1) {
		document.getElementById("banner_image").style.background = "url(images/banner_top_pre1_main.jpg) no-repeat";
	} else if(n ==2) {
		document.getElementById("banner_image").style.background = "url(images/banner_top_sil1_main.jpg) no-repeat";
	} else if(n == 3) {
		document.getElementById("banner_image").style.background = "url(images/banner_top_sel1_main.jpg) no-repeat";
	}
}
// DISPLAY BANNER FUNCTION END HERE----------------------------------------------------------/
