/*

	Copyright Bengosul @xxxynetwork.com
	
*/
var clipindex=0;
var totalClips=0;
var loopClips=true;

function srch_off(id){
	var o = document.getElementById(id);
	if (!o) {return;}
	if (o.value == '') {
		o.value='search...';
	}
}

function srch_on(id){
	var o = document.getElementById(id);
	if (!o) {return;}
	if (o.value == 'search...') {
		o.value='';
	}
}

function search_do(){
	var frm=document.forms[0];
	if (!frm) {return false;}
	frm.submit();
	return true;
}



function GUI_ready(){
	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.babeexplorer.com/", "Babe Explorer - Hottest Pornstar Movies");
	} else if (window.sidebar) {
		window.sidebar.addPanel("Babe Explorer - Hottest Pornstar Movies", "http://www.babeexplorer.com/","")
	}
}

function mo(o){o.className=='stateoff'?o.className='stateon': o.className=o.className;}
function mx(o){o.className=='stateon'?o.className='stateoff': o.className=o.className;}
function mc(o){o.className='stateclicked';}
function preurlrew(obj,pre,url){
	if (obj!=null) {
		obj.href=pre+url;
		return true;
	} else {
		return false;
	}
}



function OnClipPlayEnded(idx) {
	//alert("Clip Index: "+idx+" has just ended");
	clipindex=++idx;
	custom_flipbg('clip'+clipindex,false,'#cccccc');
/*	clipindex++;
	if (clipindex==totalClips) {
		if (loopClips) {
			clipindex=1;
			custom_flipbg('clip'+clipindex,true,'#cccccc');
		}
	} else {
		custom_flipbg('clip'+clipindex,true,'#cccccc');
	}*/
	return false;
}

function OnClipPlayStarted(idx) {
	//alert("Clip Index: "+idx+" has just started");
	clipindex=++idx;
	custom_flipbg('clip'+clipindex,true,'#cccccc');
	return false;
}



function custom_flipbg (id,o,color) {
	var obj=document.getElementById(id);
	if (obj) {
		if (o) {
			obj.style.backgroundColor=color;	
		} else {
			obj.style.backgroundColor="";	
		}
	}
}

function OnSceneMouseOver(sceneid,o){
	var obj=document.getElementById('clip'+sceneid);
	if (obj) {
		if (o) {
			obj.style.backgroundColor="#E6E6E6";	
		} else {
			if (sceneid==clipindex) {
				obj.style.backgroundColor="#cccccc";
			} else {
				obj.style.backgroundColor="";	
			}
		}
	}		
}


function flipbg (id,o) {
	var obj=document.getElementById(id);
	if (obj) {
		if (o) {
			obj.style.backgroundColor="#E6E6E6";	
		} else {
			obj.style.backgroundColor="";	
		}
	}
}


function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}


function playClip(id) {
	id--;
	var movie=thisMovie('vplayer');
	if (movie==null) {return ;}
	movie.PlayClipCallBack(id);
}









