﻿// Flash Activating Script

// s: source url
// d: flash id
// w: source width
// h: source height
// t: wmode ("" for none, transparent, opaque ...)

function mf(s,d,w,h,t){
        return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+w+" height="+h+" id="+d+"><param name=wmode value="+t+" /><param name=movie value="+s+" /><param name=quality value=high /><embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+"></embed></object>";
}
// write document contents
function documentwrite(src){
        document.write(src);
}

// assign code innerHTML
function setcode(target, code){
        target.innerHTML = code;
}

function over(id,url){
document.all[id].src= "../images/" + url + "s.gif";
}

function out(id,url){
document.all[id].src= "../images/" + url + ".gif";
}

function bartab(id,pagenum,start,max){
	tabid = "tab" + id;	
	txtid= "txt" + id;
	tabsrc=   pagenum + "_tab0" + id + "s.gif";

	for(var i = start; i<=max; i++){
		hidtabid = "tab" + i;
		hidtxtid = "txt" + i;
		document.all[hidtabid].src= pagenum + "_tab0" + i + ".gif";
		document.all[hidtxtid].style.display='none';
	}
	document.all[tabid].src= tabsrc;
	document.all[txtid].style.display='block';
}

function get_cookie(name) 
{
	var find_sw = false;
	var start, end;
	var i = 0;

	for (i=0; i<= document.cookie.length; i++)
	{
		start = i;
		end = start + name.length;

		if(document.cookie.substring(start, end) == name) 
		{
			find_sw = true
			break
		}
	}

	if (find_sw == true) 
	{
		start = end + 1;
		end = document.cookie.indexOf(";", start);

		if(end < start)
			end = document.cookie.length;

		return document.cookie.substring(start, end);
	}
	return "";
}
 function set_cookie(name, value, expirehours, domain) 
{
	var today = new Date();
	today.setTime(today.getTime() + (60*60*1000*expirehours));
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
	if (domain) {
		document.cookie += "domain=" + domain + ";";
	}
}


function viewZoom(obj, disp){
	var a=obj.getElementsByTagName('IMG');
	for(var i=0,l=a.length;i<l;i++){
		if( a[i].getAttribute('zoom')!=null){
			a[i].style.display=disp;return;
		}
	}
}


var popup_win=0;
function open_window(url, width, height, scrollbars ){
	var a = screen.width;
	var b = screen.height;
	var aleft = a/2 - width/2;
	var atop = b/2 - height/2;
 
	if(scrollbars == null) scrollbars = "yes";
  
	if(popup_win)
		if(!popup_win.closed) popup_win.close();

	popup_win = open( url, "window_id", 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scrollbars+',resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+aleft+', top='+atop+',screenX='+aleft+',screenY='+atop+'');
	popup_win.focus();
}