// JavaScript Document

//----ACTIVATING FLASH-----
function flash(flash_content){
	document.write(flash_content);
	}
//----ACTIVATING FLASH-----

//----COVER MAIN CONTENT WITH TRANSPARENT BLOCK-----
	function coverall(id, act){
		var obj = document.getElementById(id);
		if(obj.style.position != 'absolute'){
			obj.style.position = 'absolute';
			obj.style.width = '100%';
			obj.style.height = '100%';
			obj.style.left = '0px';
			obj.style.top = '0px';
			obj.style.zIndex = '10';
			var objdiv = obj.getElementsByTagName('DIV')[0];
			objdiv.style.backgroundImage = urlref+'url(img/design/spacer.gif)';
			objdiv.style.position = 'absolute';
			objdiv.style.width = '100%';
			objdiv.style.height = '100%';
			objdiv.style.left = '0px';
			objdiv.style.top = '0px';
		}
		if(act == 'show'){
			var coverarr = document.getElementsByTagName('SELECT');
			for(i=0; i<coverarr.length; i++){
				coverarr[i].style.visibility = 'hidden';
			}
			document.getElementById('imenus0').style.display = 'none';
			document.getElementById(id).style.display = '';
			document.getElementById(id).style.height = document.getElementById('pageheight').offsetTop +'px';
			correctPNG();
		}else{
			document.getElementById(id).style.display = 'none';
			document.getElementById('imenus0').style.display = '';
			var coverarr = document.getElementsByTagName('SELECT');
			for(i=0; i<coverarr.length; i++){
				coverarr[i].style.visibility = 'visible';
			}
		}
	}
	function coverallbg(){
		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="100%" height="100%" id="coverallbg" align="top">'
			+'<param name="allowScriptAccess" value="sameDomain" />'
			+'<param name="movie" value="flash/reg_bg.swf" />'
			+'<param name="quality" value="high" />'
			+'<param name="wmode" value="transparent" />'
			+'<param name="bgcolor" value="#ffffff" />'
			+'<embed src="flash/reg_bg.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="coverallbg" align="top" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
			+'</object>');
	}
//----END COVER MAIN CONTENT WITH TRANSPARENT BLOCK-----

//----ADD FAVORITES, PRINT, MAILTO----
//bookmark
function addfav (fav){//alert(location.href);
	netscape="Hit CTRL+D to add a bookmark to this site."
	if (navigator.appName=='Microsoft Internet Explorer'){
		window.external.addFavorite(location.href, fav);
	}
	else if (navigator.appName=='Netscape'){
		alert(netscape);
	}
}
function printp (){
	window.print();
}
//----ADD FAVORITES, PRINT, MAILTO----

function $(id){return document.getElementById(id);}

function thumb(id){
	//clearTimeout(thumbinterval);
	var pref = id.substring(0,3);
	var id = id.substring(3,id.length);
	var i=0;
	//alert(pref+id+' - '+thumbact)
	if(thumbact)
		clearTimeout($(thumbact).thumbinterval);
	while($(pref+i)){
		$(pref+i).style.display = 'none';
		i++;
	}
	$(pref+id).style.display = '';
}
var thumbact;
var idout;
function thumbout(id){
	if(!$(id).thumbinterval){thumbact = id; $(id).thumbinterval=1;}
	idout = id;
	$(id).thumbinterval = setTimeout(function(){
		var pref = idout.substring(0,3);
		idout = idout.substring(3,idout.length);
		var i=0;
		while($(pref+i)){
			$(pref+i).style.display = 'none';
			i++;
		}
		$(pref+idout).style.display = '';
	},300);
}

///// PNG FIX /////////////////////

function correctPNG(reg){ // correctly handle PNG transparency in Win IE 5.5 or higher.
		if(window.showHelp){
		for(var i=0; i<document.images.length; i++)
			{
			var img = document.images[i];
			if(img.id.substring(0,3) != 'reg'){
				var imgName = img.src.toUpperCase()
					if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
						{
						var imgID = (img.id) ? "id='" + img.id + "' " : ""
						var imgClass = (img.className) ? "class='" + img.className + "' " : ""
						var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
						var imgStyle = "display:inline-block;" + img.style.cssText
						if (img.align == "left") imgStyle = "float:left;" + imgStyle
						if (img.align == "right") imgStyle = "float:right;" + imgStyle
						if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
						var strNewHTML = "<span " + imgID + imgClass + imgTitle
						+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
						+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
						+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
						img.outerHTML = strNewHTML
						i = i-1
					}
				}
			}
		}
	}
//if(window.showHelp)
	//window.attachEvent("onload", correctPNG);


// PHOTOGALLERY
var lastShowImg  = 1;
function showbigfot(imgsrc, divId, width, height){
	if(document.getElementById('foto_line_'+lastShowImg))document.getElementById('foto_line_'+lastShowImg).style.display = 'none';
	if(document.getElementById('foto_line_'+divId)){
		div = document.getElementById('foto_line_'+divId);
		div.style.display = 'block';
		img = div.getElementsByTagName('IMG')[0];
		img.width = width;
		img.height = height;
		img.src = imgsrc;
	}
	lastShowImg = divId;
}


