/*

	Copyright Bengosul @xxxymovies.com
	
*/

var srch=false;

netscapeTest = parseInt(navigator.appVersion);
explorerTest = navigator.appName.indexOf("Microsoft") + 1;

function netscapeThree() {
     if (navigator.javaEnabled()) {
          userDomain = java.net.InetAddress.getLocalHostName()
          return (userDomain.toString())
     } else {
          return null
     }
}

function netscapeFour() {
     if (navigator.javaEnabled()) {
          baseAddress = java.net.InetAddress.getLocalHost()
          userDomain = baseAddress.getHostName()
          return (userDomain.toString())
     } else {
          return null
     }
}



if ((explorerTest == "0") && (netscapeTest == "3")) {
     refdomainName = netscapeThree();
} else if ((explorerTest == "0") && (netscapeTest == "4")) {
     refdomainName = netscapeFour();
} else {
     refdomainName = "null"
}


function search_on(){
	if (srch==false) {
		srch=true;
		document.getElementById('srch').style.display='';
	} else {
		srch=false;
		document.getElementById('srch').style.display='none';
	}
}

var curIdx=1;
var maxIdx=6;
var SlidePlaying=false;
var TimerId = 0;
var media_host="";
var mpath="";
var msz="1";

function StartSlide(s,id,mp,fr) {
	if (SlidePlaying==false) {
		msz=s;
		media_host=mp;
		mpath=fr;
		curIdx=0;
		TimerId=setTimeout("ShowSlide('" +id+ "')", 800);
		SlidePlaying=true;
	}
}
function StopSlide(id,mp) {
	//restore
	clearTimeout(TimerId);
	curIdx=mp;
	document.getElementById(id).src=media_host+"a"+curIdx+msz+"_"+mpath;
	
	TimerId=0;
	SlidePlaying=false;
	curIdx=1;
}
function ShowSlide(id){
	if (SlidePlaying==true) {
		if (curIdx==6) {
			curIdx=0;
		}
		curIdx++;
		document.getElementById(id).src=media_host+"a"+curIdx+msz+"_"+mpath;
		TimerId=setTimeout("ShowSlide('"+id+"')", 400);
		
	}
}

function GUI_ready(){
	if (domainName == 'truveo.com') {
		return;
	}
	if (top.location != location) {
		top.location.href = document.location.href ;
	}
	window.moveTo(0,0);
	if (document.all) {
		top.window.resizeTo(screen.availWidth,screen.availHeight);
	}
	else if (document.layers||document.getElementById) {
		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth) {
			top.window.outerHeight = screen.availHeight;
			top.window.outerWidth = screen.availWidth;
		}
	}
}
function bookmarksite(){
	if (document.all) {
		window.external.AddFavorite("http://www.xxxymovies.com/", "XXX Movies - Watch free xxx movies online");
	} else if (window.sidebar) {
		window.sidebar.addPanel("XXX Movies - Watch free xxx movies online", "http://www.xxxymovies.com/", "")
	}
}

function flipbg (id,o) {
	var obj=document.getElementById(id);
	if (obj) {
		if (o) {
			obj.style.backgroundColor="#333333";	
		} else {
			obj.style.backgroundColor="";	
		}
	}
}

if (window != top) top.location.href = location.href;