// Title: ZebraNights Header JavaScripts
// URL: http://www.zebranights.com
// Version: 6.0

function hidestatus(){
	window.status=''
	return true
}

//if (document.layers)
//document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

//document.onmouseover=hidestatus
//document.onmouseout=hidestatus

confirmdelete = function(znurl) {
	var yourstate=window.confirm("NOTE!!!\n\nYou are about to delete this item\n\nClick OK to continue");
	if (yourstate) {top.document.getElementById('main_body').src=znurl;}
};
confirmdeleteA = function(url) {
	var yourstate=window.confirm("NOTE!!!\n\nYou are about to delete this item\n\nClick OK to continue");
	if (yourstate){top.frames[2].location.href=url;}
};
confirmdeleteB = function(url) {
	var yourstate=window.confirm("NOTE!!!\n\nYou are about to delete this item\n\nClick OK to continue");
	if (yourstate) {document.getElementById('adminit').src=url;}
};
function launchpopupscroll(url, name, width, height,scroll) {
   winSet = "toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0,width="+width +",height="+height+",left="+(screen.availWidth-width)/2+",top="+(screen.availHeight-height)/2;
   var mypopwndA = window.open("", name, winSet);
   var mypopwndB = window.open(url, name);
}

function launchpopup(url, name, width, height) {
   winSet = "toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,status=0,width="+width +",height="+height+",left="+(screen.availWidth-width)/2+",top="+(screen.availHeight-height)/2;
   var mypopwndA = window.open("", name, winSet);
   var mypopwndB = window.open(url, name);
}

function launchsuccesspopup(url, name, width, height) {
   winSet = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=yes";
   winSet += ",width="+width +",height="+height+",left="+(screen.availWidth-width)/2+",top="+(screen.availHeight-height)/2;
   mypopwnd = window.open(url, name, winSet);
   mypopwnd.focus();
}

function launchwindow(url) {
   winSet = "toolbar=yes,location=no,directories=no,menubar=yes,scrollbars=yes,resizable=yes";
   mywnd = window.open(url, '', winSet);
}

function impopup(url){
	newwindow = window.open(url,'name','height=500,width=230,left=20,top=20,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,status=no,resizable=yes,fullscreen=no');
	newwindow.focus();
}

function chatpopup(url){
	newwindow = window.open(url,'zchat','width=600,height=488,left=380,top=120,toolbar=no,menubar=no,directories=no,location=no,scrollbars=no,status=no,resizable=no,fullscreen=no');
	newwindow.focus();
}

if(document.getElementById&&!document.all){ns6=1;}else{ns6=0;}
var agtbrw=navigator.userAgent.toLowerCase();
var operaaa=(agtbrw.indexOf('opera')!=-1);
var head="display:''";
var folder='';
var zn_dupCounter = 1;
 
function expandit(curobj){
	if(document.getElementById(curobj)){
		folder=document.getElementById(curobj).style;
	}else{
		if(ns6==1||operaaa==true){
			folder=curobj.nextSibling.nextSibling.style;
		}else{
			folder=document.all[curobj.sourceIndex+1].style;
		}
	}
	if (folder.display=="none"){folder.display="";}else{folder.display="none";}
}

function expandit2(curobj, hide) {
	if(document.getElementById(curobj)) {
  		folder=document.getElementById(curobj).style;
	} else {
		if(ns6==1||operaaa==true) {
			folder=curobj.nextSibling.nextSibling.style;
		} else {
			folder=document.all[curobj.sourceIndex+1].style;
		}
   }
	if(folder.display=="none")
	{
		folder.display="";
	} else {
		folder.display="none";
	}
	if(hide) {
		var hide_objects = hide.split(",");
		for(i=0; i<hide_objects.length; i++) {
			hide_objects[i]=hide_objects[i].replace(/^\s*(.*)/, "$1");
			hide_objects[i]=hide_objects[i].replace(/(.*?)\s*$/, "$1");
			if(document.getElementById(hide_objects[i])) {
				hidden=document.getElementById(hide_objects[i]).style;
				if(hidden.display=="") {
					hidden.display="none";
				}
			}
		}
	}
}

function loadstatusaccount(){
	parent.main_body.location='/pim/show_status_account.php';
}
function loadstatusprofile(){
	parent.main_body.location='/pim/show_status_profile.php';
}
function loadstatussubs(){
	parent.main_body.location='/subscribe/subs_decide.php';
}

function mOut(src, colour){
	src.style.backgroundColor = colour;
}
function mFlip(control){
	if(document.getElementById(control)){
		oControl=document.getElementById(control).style;
	}else{
		if(ns6==1||operaaa==true){
			oControl=control.nextSibling.nextSibling.style;
			
		}else{
			oControl=document.all[control.sourceIndex+1].style;
		}
	}
	oText=document.getElementById([control + "T"]);
	if (oControl.display == "none"){
		oControl.display = "";
		oText.innerHTML = "Hide Item";
	}else{
		oControl.display = "none";
		oText.innerHTML = "Show Item";
	}
}
function mOver(src, colour){ 
	src.style.cursor = 'hand';
	src.style.backgroundColor = colour;
}
function mClick(src){
	if(event.srcElement.tagName=='TD'){
		src.children.tags('A')[0].click()
	}
}
function confirmit(url) {
	var yourstate=window.confirm("WARNING!!!\n\nYou are about to view Explicit Adult content\n\nAre you sure? Click OK for yes");
	if (yourstate) top.frames[1].location.href=url;
}
function requestit(url) {
	var yourstate=window.confirm("Make sure that you have contacted this Profile before\nrequesting to see the Album, OR at the very least, make\nsure you have READ the Profile.\n\nDo you want to Request access to this Private Album?\n\nClick OK for yes");
	if (yourstate) top.frames[1].location.href=url;
}
function noticeit(msg) {
	var yourstate=window.alert(msg);
}
znModalNotice = function(caption,msg) {
	msg += "<br><br><br><p align='center'><input type='button' class='simplemodal-close button' value=' Close '></p><br>";
	$.modal("<TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='1' CELLPADDING='6'><TR><td class='fcaption'>" + caption + "</td></TR></TABLE><br><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
znModalNotice2 = function(msg) {
	msg += "<br><br><br><p align='center'><input type='button' class='simplemodal-close button' value=' Close '></p><br>";
	$.modal("<TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='1' CELLPADDING='6'><TR><td class='fcaption'><b>NOTICE!</b></td></TR></TABLE><br><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
vip_notice2 = function() {
	var yourstate=window.confirm("ACCESS RESTRICTED!\n\nYou need to be a subscriber in order to access this part of Adults.\n\nClick OK to go to `Subscribe`");
	if (yourstate) {top.frames[1].location.href='/subscribe';}
}; 
vip_notice = function() {
	msg = "You need to be a VIP subscriber in order to access this part of Adults.";
	msg += "<br><br><br><p align='center'><a href='/subscribe/' target='main_body'><b>Click Here to Subscribe</b></a></p>";
	msg += "<br><br><p align='center'><input type='button' class='simplemodal-close button' value=' Close '></p><br>";
	$.modal("<TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='1' CELLPADDING='6'><TR><td class='fcaption'><b>ACCESS RESTRICTED!!</b></td></TR></TABLE><br><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
function duplicateHTML(copy,paste,baseid){
	if(document.getElementById(copy)){
		zn_dupCounter++;
		var type = document.getElementById(copy).nodeName; // get the tag name of the source copy.

		var but = document.createElement('input');
		var br = document.createElement('br');

		but.type = 'button';
		but.value = 'x';
		but.className = 'button';
		but.onclick = function(){ this.parentNode.parentNode.removeChild(this.parentNode); };

		var destination = document.getElementById(paste);
		var source      = document.getElementById(copy).cloneNode(true);

		var newentry = document.createElement(type);

		newentry.appendChild(source);
		newentry.value='';
		newentry.appendChild(but);
		newentry.appendChild(br);
		if(baseid) {
			newid = baseid+zn_dupCounter;
			newentry.innerHTML = newentry.innerHTML.replace(new RegExp(baseid, 'g'), newid);
			newentry.id=newid;
		}

		destination.appendChild(newentry);
	}
}
