function mmouseover(menuname)
{
  obj = document[menuname];
  obj.style.cursor = 'pointer';
  obj.src = images[menuname + 'over'].src;
}

function mmouseout(menuname)
{
  obj = document[menuname];
  obj.src = images[menuname].src;
}

function gotopage(url)
{
  window.location.href = url;
}

function chm(imname)
{
  obj = document[imname];
  obj.style.cursor = 'pointer';
}



/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
how to use:
<a style="cursor: hand" href="/swish-templates/13464.html" target="_blank"><IMG SRC="http://images.templatemonster.com/screenshots/13400/13464-m.jpg" border=0 alt='Template 13464' border=1 style="border-color: 777777"
        	onmouseover="showtrail('http://images.templatemonster.com/screenshots/13400/13464-bswi.jpg ','Template 13464',430,425)"   onmouseout="hidetrail()"
	 ></a>
*/

var offsetfrommouse=[25,-155]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=2; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 400;	// maximum image size.
var t_id = 0;
var currentimagewidth = 530;	// maximum image size.
var timer;

var pos=0;
var dir=2;
var len=0;

function getSize() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth; myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
		myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;
	}
	return [myWidth,myHeight];
}
function getScrollXY() {
	var scrOfX = 0, scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;
	}
	return[scrOfX,scrOfY];
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("preview_div").style
else if (document.all && document.all.trailimagid.style) return document.all.trailimagid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("preview_div")
else if (document.all && document.all.trailimagid) return document.all.trailimagid
}


function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function hidetrail(){
	gettrailobj().display= "none";
	document.onmousemove=""
	gettrailobj().left="-500px"
	clearTimeout(timer);
}

function showtrail(imagename,serienaam,title,showthumb, imageheight, imagewidth){
     i=imagename
	 serie = serienaam
	 t=title
	 s = showthumb
	 h = imageheight
	 w = imagewidth
	currentimagewidth=imagewidth
	timer = setTimeout("show('"+i+"',serie,t,s,h,w);",200);
}
function show(imagename,serie,title,showthumb,height,width){
    var currentimageheight = height;
    var currentimagewidth = width;

	document.onmousemove=followmouse;
	t_id = setInterval(animate,20);
    width=width+10
	newHTML = '<div class="border_preview" style="width:' + width + '"><div id="loader_container"><div id="loader" style="position:relative;">Loading template preview...<div id="loader_bg"><div id="progress"> </div></div></div></div>';
	newHTML = newHTML + '<div class="heading2"><b>' + serie + '</b></div>'
	newHTML = newHTML + '<div class="heading2" >' + title + '</div>'
	if (showthumb > 0){
    newHTML = newHTML + '<div class="popupfoto"><img onload="javascript:remove_loading();" src="' + imagename + '" ></div>';

	newHTML = newHTML + '</div>';
	/*framewidth = currentimagewidth+5; */
 /* if ((navigator.userAgent.indexOf("Firefox")==-1) && (navigator.userAgent.indexOf("Opera")==-1) ) {
  newHTML = newHTML+'<iframe src="about:blank" scrolling="no" frameborder="2" width="'+framewidth+'" height="'+currentimageheight+'"></iframe>';
	}
 */
	var obj_id = gettrailobjnostyle()
	obj_id.innerHTML = newHTML;

	gettrailobj().display="block";

}


function followmouse(e){
//var currentimageheight = 160 // height of picture + title + background
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]

	var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

	//if (document.all){
	//	gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
	//} else {
	//	gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
	//}

	if (typeof e != "undefined"){
    // not IE;

		if (docwidth - e.pageX < 380){
			xcoord = e.pageX - xcoord - width - 10; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
	// e.pageY= mouseY
	//alert (offsetfrommouse[1]

	ycoord += e.pageY - Math.max(0,(e.pageY + currentimageheight - docheight - truebody().scrollTop -8));





	} else if (typeof window.event != "undefined"){
	// IE ;
		if (docwidth - event.clientX < 380){
			xcoord = event.clientX + truebody().scrollLeft - xcoord - 400; // Move to the left side of the cursor
		} else {
			xcoord += truebody().scrollLeft+event.clientX
		}

			ycoord += event.clientY + truebody().scrollTop - Math.max(0,( currentimageheight + event.clientY - docheight - 35));

	}

	if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobj().left=xcoord+"px"
	gettrailobj().top=ycoord+"px"

}
}

function animate()
{
	var elem = document.getElementById('progress');
	if(elem != null) {
		if (pos==0) len += dir;
		if (len>32 || pos>79) pos += dir;
		if (pos>79) len -= dir;
		if (pos>79 && len==0) pos=0;
		elem.style.left = pos;
		elem.style.width = len;
	}

}

function remove_loading() {
	this.clearInterval(t_id);
	var targelem = document.getElementById('loader_container');
	targelem.style.display='none';
	targelem.style.visibility='hidden';
	//var t_id = setInterval(animate,60);
}

function valuesOf(a)
{
    var doc=document.getElementById('imgkod');
            doc.innerHTML= "<img src='http://www.websitedesign-websitetemplate.com/noautoreg.php?q="+Math.round(Math.random() * 100)+"'>";
    return 1;
}