// 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="wmode" value="transparent" />');
document.write('<param name="allowScriptAccess" value="always" />');
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>');

};

function Flash8_loop(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" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="allowScriptAccess" value="always" />');
document.write('<embed src="' + src + '" menu="true" quality="high" swLiveConnect="true" bgcolor="100%" width="100%" height="' + height + '" name="' + idname + '" id="' + idname + '" align="top" loop="true" salign="lt" type="application/x-shockwave-flash" allowScriptAccess="always" pluginspage="https://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) - 170;
		if (start > finish) {
        scrollUp(start,finish); 
        } else {
        scrollDown(start,finish) 
        }
};        

function scrollDown(start,finish) {
        newAnchorsY = (parseInt(finish)+150)+"px";
        document.getElementById('anchors').style.top=newAnchorsY;
        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) {
        newAnchorsY = (parseInt(finish)+150)+"px";
        document.getElementById('anchors').style.top=newAnchorsY;
        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));
}


// CLEAR SEARCH WIDGET SCRIPT

var cleared = false;

function clearCheck(input)
{
  if(!cleared)
  {
    input.value = '';
    cleared = true;
  }  
}


// ----------------------------------------------
// StyleSwitcher functions written by Paul Sowden
// http://www.idontsmoke.co.uk/ss/
// - - - - - - - - - - - - - - - - - - - - - - -
// For the details, visit ALA:
// http://www.alistapart.com/stories/alternate/
//
// nifty StyleSwitcher scripts modified by Aaron Jones 10/10/2002
// ----------------------------------------------

function setActiveStyleSheet(title, reset) {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
  if (reset == 1) {
    var date = new Date();
    date.setTime(date.getTime()+(365*24*60*60*1000));
    var expires = ";expires="+date.toGMTString();

    document.cookie = "gattis="+title+expires+";";
  }
}

function setStyle()
{
  var nameEQ = "gattis=";
  var ca = document.cookie.split(';');
  var style = null;
  
  for(var i=0;i < ca.length;i++)
  {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) style = c.substring(nameEQ.length, c.length);
  }
  
  if(style != null)
  {
    setActiveStyleSheet(style, 0);
  }
}

