// Title: ZNights Header JavaScripts
// URL: http://www.znights.com
// Version: 11.41
showScriptVersion = function() {
	var yourstate=window.alert("ZNights Script Engine Version\n\nZNights is currently running v11.41");
};
showScriptVersion2 = function() {
	document.write("v11.41");
};
hidestatus = function(){
	window.status='';
	return true;
};
if (document.layers) {
	document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.MOUSEMOVE);
	document.onmouseover=hidestatus;
	document.onmouseout=hidestatus;
}

confirmit = function(url) {
	var yourstate=window.confirm("NOTE!!!\n\nYou are about to view Explicit Adult content\n\nClick OK to continue");
	if (yourstate){znpagefetcher.load('gallerybody', url, true, '', '');}
};
confirmit2 = function(url,frame) {
	var yourstate=window.confirm("NOTE!!!\n\nThis action requires you to confirm it\n\nClick OK to continue");
	if (yourstate){parent.document.getElementById(frame).src=url;}
};
confirmit3 = function(url,frame) {
	var yourstate=window.confirm("NOTE!!!\n\nThis action requires you to confirm it\n\nClick OK to continue");
	if (yourstate){document.getElementById(frame).src=url;}
};
confirmdelete = function(znurl,znframe) {
	var yourstate=window.confirm("NOTE!!!\n\nYou are about to delete this item\n\nClick OK to continue");
	if (yourstate) {document.getElementById(znframe).src=znurl;}
};
confirmdelete2 = function(znurl) {
	var yourstate=window.confirm("NOTE!!!\n\nYou are about to delete this item\n\nClick OK to continue");
	if (yourstate) {document.location.href=znurl;}
};
requestalbum = function() {
	msg = "You need to contact this Profile directly (via the Mail tab on their Profile is a good way) and ask their permission for access.<br><br><p align='center'>Be Polite and Respectful.</p>";
	msg += "<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><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
requestvideos = function() {
	msg = "You need to contact this Profile directly (via the Mail tab on their Profile is a good way) and ask their permission for access.<br><br><p align='center'>Be Polite and Respectful.</p>";
	msg += "<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><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
noticeit = function(msg) {
	var yourstate=window.alert(msg);
};
znModalNotice = function(caption,msg) {
	msg += "<p align='center'><input type='button' class='simplemodal-close button' value=' Close '></p>";
	$.modal("<TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='1' CELLPADDING='6'><TR><td class='fcaption'>" + caption + "</td></TR></TABLE><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});
};
level2_notice = function() {
	msg = "You need to complete your Profile to access this part of ZNights.<br><br><p align='center'><a class='menu2B' href='/pim/account/index.php?account_menu=2' target='main_body'>Click Here to Edit it Now</a></p>";
	msg += "<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>PROFILE NOT COMPLETE!!</b></td></TR></TABLE><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
level2_notice2 = function() {
	var yourstate=window.confirm("PROFILE NOT COMPLETE!\n\nYou need to complete your Profile to access this part of ZNights.\n\nPlease goto `Members/Account/Profile`");
	if (yourstate) {top.frames[1].location.href='/pim/account/';}
};
vip_notice2 = function() {
	var yourstate=window.confirm("ACCESS RESTRICTED!\n\nYou need to be a subscriber in order to access this part of ZNights.\n\nClick OK to go to `Subscribe`");
	if (yourstate) {top.frames[1].location.href='/subscribe/';}
};
vip_notice = function() {
	msg = "You need to be a Subscriber in order to access this part of ZNights.<br><br><p align='center'><a class='menu2B' href='/subscribe/' target='main_body'>Click Here to Subscribe</a></p>";
	msg += "<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><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
timeout = function(nick) {
	var yourstate=window.alert("TIMEOUT!!!\n\nAt some point you have offended a ZNights member which has caused them to give you a TimeOut.\n\nThis TimeOut will expire automatically.\n\nThis means that while the TimeOut is in effect, you can not contact them at all.");
};
timeout_msg = function(nick,expire) {
	msg = "At some point you have offended '" + nick + "' which has caused them to give you a TimeOut.<br><br>This TimeOut will expire automatically on: " + expire + ".<br><br>This means that while the TimeOut is in effect, you can not contact them at all.<br>";
	msg += "<br><p align='center'><input type='button' class='simplemodal-close button' value=' Close '></p><br><br><br>";
	$.modal("<TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='1' CELLPADDING='6'><TR><td class='fcaption'><b>TIMEOUT!!</b></td></TR></TABLE><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
timeout_msg_p = function(nick) {
	msg = "At some point you have REALLY offended '" + nick + "' which has caused them to give you a Permanent TimeOut.<br><br>This TimeOut will NOT expire automatically and will have to be manually removed.<br><br>This means that you can not contact them at all.<br>";
	msg += "<br><p align='center'><input type='button' class='simplemodal-close button' value=' Close '></p><br><br><br>";
	$.modal("<TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='1' CELLPADDING='6'><TR><td class='fcaption'><b>PERMANENT TIMEOUT!!</b></td></TR></TABLE><TABLE WIDTH='100%' align='center' BORDER='0' CELLSPACING='10' CELLPADDING='6'><TR><td>" + msg + "</td></TR></TABLE>", {close:false});
};
events_notice = function() {
	msg = "You need to be a Club/Organiser or Event Partner in order to access this part of ZNights.";
	msg += "<br><br><br><p align='center'><a class='simplemodal-close' href='#' onclick='javascript:znpagefetcher.load(\"interactbody\", \"/pim/interact/events_apply.php\", true, \"\", \"\");updateIT(\"label\",\"My Interactions: Events\");setTabs(\"interact\",\"4\");'><b>Click Here to Apply</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});
};
launchpopupscroll = function(url, name, width, height,scroll) {
   winSet = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,status=no";
   winSet += ",width="+width +",height="+height+",left="+(screen.availWidth-width)/2+",top="+(screen.availHeight-height)/2;
   mypopwnd = window.open(url, name, winSet);
};
launchpopup = function(url, name, width, height) {
   launchpopupscroll(url, name, width, height,"yes");
};
launchpopupIframe = function(url, width, height) {
   launchpopupscroll(url, "popup", width, height,"yes");
};
commspopup = function(mode,submode){
	newwindow = window.open('/comms/index.php?comms_mode='+mode+'&comms_sub='+submode,'comms','width=805,height=555,toolbar=no,menubar=no,directories=no,location=no,scrollbars=yes,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;
expandit = function(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";}
};
expandit2 = function(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";
				}
			}
		}
	}
};
expanditPlay = function(curobj){
	if(curobj=="span_flirts") {
		document.getElementById("span_smiles").style.display="none";
		document.getElementById("span_pokes").style.display="none";
	}
	if(curobj=="span_smiles") {
		document.getElementById("span_flirts").style.display="none";
		document.getElementById("span_pokes").style.display="none";
	}
	if(curobj=="span_pokes") {
		document.getElementById("span_flirts").style.display="none";
		document.getElementById("span_smiles").style.display="none";
	}
	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";}
};
loadstatussubs = function(){
	parent.main_body.location='/subscribe/subs_decide.php';
};
mOut = function(src, colour){
	src.style.backgroundColor = colour;
};
mFlip = function(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";
	}else{
		oControl.display = "none";
		oText.innerHTML = "Show";
	}
};
aFlip = function(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"]);
	iText=document.getElementById([control + "I"]);
	if (oControl.display == "none"){
		oControl.display = "";
		oText.innerHTML = "<b>Less</b>";
		iText.style.display = "none";
	}else{
		oControl.display = "none";
		oText.innerHTML = "<b>More</b>";
		iText.style.display = "";
	}
};
if (hs) {
	hs.registerOverlay(
	   	{
	   		thumbnailId: null,
	   		overlayId: 'controlbar',
	   		position: 'top right',
	   		hideOnMouseOut: true
		}
	);
	hs.graphicsDir = '/js_11.41/highslide/graphics/';
	hs.outlineType = 'rounded-white';
	hs.captionEval = 'this.thumb.title';
}
function znRollover() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('znroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/znroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/znroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/znroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}
var mode = 0;
function user_events_set(mode) {
	document.attend.comment.value='';
	if(mode == 1) { document.getElementById('attend_form').style.display=''; }else{ document.getElementById('attend_form').style.display='none'; }
	if(mode == 2) { document.getElementById('attend_form_ok').style.display=''; }else{ document.getElementById('attend_form_ok').style.display='none'; }
	if(mode == 3) { document.getElementById('attend_form_err').style.display=''; }else{ document.getElementById('attend_form_err').style.display='none'; }
	if(mode == 4) { document.getElementById('attend_form_del').style.display=''; }else{ document.getElementById('attend_form_del').style.display='none'; }
	if(mode == 5) { document.getElementById('attend_form_del_ok').style.display=''; }else{ document.getElementById('attend_form_del_ok').style.display='none'; }
}
function user_events_set2(mode) {
	if(mode == 1) { document.getElementById('attend_form').style.display=''; }else{ document.getElementById('attend_form').style.display='none'; }
	if(mode == 4) { document.getElementById('attend_form_del').style.display=''; }else{ document.getElementById('attend_form_del').style.display='none'; }
}
function user_validate_set2(mode) {
	if(mode == 1) { document.getElementById('validate_form').style.display=''; }else{ document.getElementById('validate_form').style.display='none'; }
	if(mode == 4) { document.getElementById('validate_form_del').style.display=''; }else{ document.getElementById('validate_form_del').style.display='none'; }
}
function roll(img_name, img_src) {
	document.getElementById(img_name).src = img_src;
}
pFlip = function(control,panel){
	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 = "<a onmouseover=\"roll('panel_" + panel + "', '/themes/common/icons/bt_close_over.png')\" onmouseout=\"roll('panel_" + panel + "', '/themes/common/icons/bt_close.png')\"><img src='/themes/common/icons/bt_close.png' id='panel_" + panel + "' border='0' title='Close'></a>";
	}else{
		oControl.display = "none";
		oText.innerHTML = "<a onmouseover=\"roll('panel_" + panel + "', '/themes/common/icons/bt_open_over.png')\" onmouseout=\"roll('panel_" + panel + "', '/themes/common/icons/bt_open.png')\"><img src='/themes/common/icons/bt_open.png' id='panel_" + panel + "' border='0' title='Open'></a>";
	}
};
tFlip = function(control,panel){
	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 = "<a onmouseover=\"roll('panel_" + panel + "', '/themes/common/icons/tt_close_over.png')\" onmouseout=\"roll('panel_" + panel + "', '/themes/common/icons/tt_close.png')\"><img src='/themes/common/icons/tt_close.png' id='panel_" + panel + "' border='0' title='Close'></a>";
	}else{
		oControl.display = "none";
		oText.innerHTML = "<a onmouseover=\"roll('panel_" + panel + "', '/themes/common/icons/tt_open_over.png')\" onmouseout=\"roll('panel_" + panel + "', '/themes/common/icons/tt_open.png')\"><img src='/themes/common/icons/tt_open.png' id='panel_" + panel + "' border='0' title='Open'></a>";
	}
};
toggle = function(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	}else{
		el.style.display = '';
	}
};
