// 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=false>");
document.write("<param name='allowScriptAccess' value=always >");
document.write("<param name='swLiveConnect' value=true >");
document.write("<EMBED src='" + src + "' menu=true quality='high' swLiveConnect=true bgcolor=" + bg + "  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>");

};




// 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 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));
}


// 

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";
}



