
// FLASH 8 OBJECT/EMBED FUNCTION

function Flash8(src,idname,width,height,bg) {
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" id="' + idname + '" align="top">');
document.write('<param name="movie" value="' + src + '" />');
document.write('<param name="menu" value="true" /><param name="salign" VALUE="lt" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="' + bg + '" />');
document.write('<param name="loop" value="true" />');
if(bg=="transparent"){
document.write('<param name="wmode" value="transparent" />');
} else {
document.write('<param name="bgcolor" value="' + bg + '" />');
}
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<embed src="' + src + '" menu="true" quality="high" swLiveConnect="true" ');
if(bg=="transparent"){
document.write('wmode="transparent" '); 
} else {
document.write('bgcolor="'+ bg +'" '); 
}
document.write('width="' + width + '" height="' + height + '" name="' + idname + '" id="' + idname + '" align="top" loop="false" salign="lt" type="application/x-shockwave-flash" allowScriptAccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer">');
document.write('</embed>');
document.write('</object>');
};


// NAVBAR MOUSE EFFECTS

function over(idname){
    imgname="images/nav_"+idname+"_on.gif";
    document.getElementById(idname).src=imgname;
}

function out(idname){
    imgname="images/nav_"+idname+".gif";
    document.getElementById(idname).src=imgname;
}



// SMOOTH SCROLLING TO AN ID FUNCTIONS


function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}


function scrollToId(id) {
		start = (document.all)?document.body.scrollTop:window.pageYOffset;
		obj = document.getElementById(id);
		finish = findPosY(obj);
		if (start > finish) {
        scrollUp(start,finish); 
        } else {
        scrollDown(start,finish) 
        }
};        

function scrollDown(start,finish) {
        if (start < finish - .9) {				
                window.scroll(0,start);  
				start += (finish-start)/3;  
				start2=start; finish2=finish;
                setTimeout('scrollDown(start2,finish2)', 1);	
        };
};

function scrollUp(start,finish) {
        if (start > finish + .9) {				
                window.scroll(0,start);  
				start += (finish-start)/3;  
				start2=start; finish2=finish;
                setTimeout('scrollUp(start2,finish2)', 1);	
        };
};



// POPUP WINDOW SCRIPT

function popup(url,name,wide,high){
// onClick="('url','name',wide,high);return false;"
	if (high=="max") 
		{ high=screen.availHeight };
	if (wide=="max")
		{ wide=screen.availWidth };
	attr="location=no,toolbar=yes,scrollbars=yes,resizable=yes,statusbar=no,width="+wide+",height="+high;
	doPopUpWindow = window.open(url,name,attr);
	doPopUpWindow.moveTo((screen.availWidth/2)-(wide/2),(screen.availHeight/2)-(high/2)-(screen.availHeight/10));
}



// HIDING ELEMENTS 

function hide(elid){
	document.getElementById(elid).style.visibility="hidden";
	document.getElementById(elid).style.display="none";
}



function showblock(elid){
	document.getElementById(elid).style.visibility="visible";
	document.getElementById(elid).style.display="block";
}



function showinline(elid){
	document.getElementById(elid).style.visibility="visible";
	document.getElementById(elid).style.display="inline";
}



// COMING SOON BADGES

function comingsoon(elid){
var soon = document.getElementById('soon');
var obj = document.getElementById(elid);
var topPx= findPosY(obj);
var leftPx= findPosX (obj);
var h= obj.offsetHeight;

soon.style.top=topPx;
soon.style.left=leftPx;
soon.style.height=h+"px";
showblock("soon");
}





