<!-- //Begin javascript
//'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//'<> Copyright (C) 2005-2006 Dogg Software All Rights Reserved
//'<>
//'<> By using this program, you are agreeing to the terms of the
//'<> SkyPortal End-User License Agreement.
//'<>
//'<> All copyright notices regarding SkyPortal must remain 
//'<> intact in the scripts and in the outputted HTML.
//'<> The "powered by" text/logo with a link back to 
//'<> http://www.SkyPortal.net in the footer of the pages MUST
//'<> remain visible when the pages are viewed on the internet or intranet.
//'<>
//'<> Support can be obtained from support forums at:
//'<> http://www.SkyPortal.net
//'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
//'::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
window.status=js_welcome;
if( top.parent.frames.length > 0){
top.parent.location.href=self.location.href;
}
/* ********** some hide/show script ********************************** */

  for (i=0; i < mmImages.length; i++) {
    var preload = new Image();
    preload.src = mmImages[i];
  }
  
function swap(imgID,img) {
 document[''+imgID+'Img'].src = mmImages[img];
 if(document[''+imgID+'Img'].alt != js_collapse ){
	document[''+imgID+'Img'].alt = js_collapse;
 }else{
	document[''+imgID+'Img'].alt = js_expand;
 }
}
// forum min/max function
function mwpHS(obj,idd,tagg){
	if(document.getElementById){
	var ar = document.getElementById(obj).getElementsByTagName(tagg);
	var cook = jsUniqueID + "hide";
	var clsNam = obj + idd;
		for (var i=0; i<ar.length; i++){
		  if(ar[i].id==clsNam){
			if(ar[i].style.display != "none"){
				swap(clsNam,0);
				ar[i].style.display = "none";
				setCookieSubKey(cook,clsNam,"1");
			}else{
				swap(clsNam,1);
				ar[i].style.display = "";
				setCookieSubKey(cook,clsNam,"0");
			}
		  }
		} 
	}
}
//themebox min/max
function mwpHSx(obj){
  if(document.getElementById){
	var ele = document.getElementById(obj);
	var cook = jsUniqueID + "hide";
	if(ele.style.display != "none"){
		swap(obj,0);
		ele.style.display = "none";
		setCookieSubKey(cook,obj,"1");
	}else{
		swap(obj,1);
		ele.style.display = "block";
		setCookieSubKey(cook,obj,"0");
	}
	//alert(cook + ' : ' + obj );
  }
}

var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

// alternate hide/show
function mwpHSa(obj,typ){
	// Netscape 4
	if(ns4){
		if (document.layers[obj]){
			if (document.layers[obj].visibility != "hide"){
				document.layers[obj].visibility = "hide";
			}else{
				document.layers[obj].visibility = "show";
			}
		}
	}
	// Explorer 4
	else if(ie4){
	  if (document.all[obj]){
		if (document.all[obj].style.visibility != "hidden"){
		  document.all[obj].style.visibility = "hidden";
		}else{
		  document.all[obj].style.visibility = "visible";
		}
	  }
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if(ie5 || ns6){
		if (document.getElementById(obj)){
			var ela = document.getElementById(obj)
			//for (var i=0; i<el.length; i++){
				if (ela.style.display != "none"){		
				  if(typ != 3){
					swap(obj,2);
				  }
				  ela.style.display = "none";
				}else{
				  if(typ != 3){
				    swap(obj,3);
				  }
				  ela.style.display = "block";
				}
			//}
		}
	}
}

//simple hide/show
function mwpHSs(obj,typ){
	// Netscape 4
	if(ns4){
		if (document.layers[obj]){
			if (document.layers[obj].visibility != "hide"){
				document.layers[obj].visibility = "hide";
			}else{
				document.layers[obj].visibility = "show";
			}
		}
	}
	// Explorer 4
	else if(ie4){
	  if (document.all[obj]){
		if (document.all[obj].style.visibility != "hidden"){
		  document.all[obj].style.visibility = "hidden";
		}else{
		  document.all[obj].style.visibility = "visible";
		}
	  }
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if(ie5 || ns6){
		if (document.getElementById(obj)){
			var ela = document.getElementById(obj)
			//for (var i=0; i<el.length; i++){
				if (ela.style.display != "none"){		
				  if(typ != 1){
					swap(obj,0);
				  }
				  ela.style.display = "none";
				}else{
				  if(typ != 1){
				    swap(obj,1);
				  }
				  ela.style.display = "block";
				}
			//}
		}
	}
}

// ++++++++++++++++++++++++ Cookie code +++++++++++++++++++++++++
    function setCookie(cname,value) {
	var timeout=60*60*24;
	var today = new Date();
	var the_date = new Date();
	the_date.setTime(today.getTime() + 1000 * timeout);
	var the_cookie_date = the_date.toGMTString();
	var the_cookie = cname +"="+value;
	var the_cookie = the_cookie + ";expires=" + the_cookie_date;
    document.cookie= the_cookie; 
    //E.g. setCookie("name1","dogg")
	}

    function getCookie(name) {
    	//alert(getCookie("name1"));
    	var result = ""; 
    	var myCookie = " " + document.cookie + ";";
    	var searchName = " " + name + "=";
    	var startOfCookie = myCookie.indexOf(searchName); 	
    	var endOfCookie; 
		if (startOfCookie != -1) {
        		startOfCookie += searchName.length; 
        		endOfCookie = myCookie.indexOf(";", startOfCookie); 
        		result = unescape(myCookie.substring(startOfCookie, endOfCookie)); 
        }
        	return result; 
    }
    //get multi value cookie value e.g. 
    //     Person=name=dogg&age=25;
    function getCookieSubKey(cookiename,cookiekey) {
        var cookievalue=getCookie(cookiename);
        if ( cookievalue == "")  return "";
        cookievaluesep=cookievalue.split("&");
        	for (c=0;c<cookievaluesep.length;c++)	{
            	cookienamevalue=cookievaluesep[c].split("=");
            	if (cookienamevalue.length > 1) {  //it has multi valued cookie
					if ( cookienamevalue[0] == cookiekey )
						return cookienamevalue[1].toString();			
                }
                else		
                	return "";		
            }	
    	return "";
	}
    //set multi value cookie value e.g. 
    //     Person=name=dogg&age=25;
	function setCookieSubKey(cookiename,cookiekey,cookiekeyvalue){
		var cookievalue=getCookie(cookiename);
        if ( cookievalue.trim() == "" ){
        	setCookie(cookiename,cookiekey+"="+cookiekeyvalue);
            return;
        }		
        //check if cookie already exist
        getcookiekeyvalue=getCookieSubKey(cookiename,cookiekey);
        newCookieValue=cookievalue.trim();
        if ( getcookiekeyvalue == "")	//key cookie never exist		
        	newCookieValue += "&" + cookiekey + "=" + cookiekeyvalue;
        else
		{
        	if ( newCookieValue.substr(0,cookiekey.length+1) == (cookiekey + "=") ) {  //Check if at first location . no beginning with &
		  	//pick rest keys = keylength+equalsign+cookiekeyvalue+nextampesand
             totalcookiekeylength=cookiekey.length+1+getCookieSubKey(cookiename,cookiekey).length+1;
             newCookieValue = newCookieValue.substr(totalcookiekeylength);
             if (newCookieValue.trim() == "")			
                newCookieValue = cookiekey + "=" + cookiekeyvalue;
             else
                newCookieValue += "&" + cookiekey + "=" + cookiekeyvalue;
           }
           else 
		   {
          	  fullcookiekey="&"+cookiekey+"="+getcookiekeyvalue;
              if ( newCookieValue.indexOf(fullcookiekey) != -1 ) //cookie key inside the cookie value
			  {
              	  newCookieValue = ReplaceAll(newCookieValue, fullcookiekey, "");
                  if (newCookieValue.trim() == "")			
                      newCookieValue = cookiekey + "=" + cookiekeyvalue;
                  else
                      newCookieValue += "&" + cookiekey + "=" + cookiekeyvalue;
               }
            }
		}
        setCookie(cookiename,newCookieValue);
	}
	//Replace all given string from a string
	//
	function ReplaceAll(varb, replaceThis, replaceBy){	
    	newvarbarray=varb.split(replaceThis);
        newvarb=newvarbarray.join(replaceBy);	
        return newvarb;
	}
	
	String.prototype.trim = function(){
    // Use a regular expression to replace
    //      leading and trailing 
    // spaces with the empty string
    return this.replace(/(^\s*)|(\s*$)/g, "");
    }
// +++++++++ End Cookie code +++++++++++++++++++++++++++++++++++++++++++++++++

// ------------functions for codebox mod
function expand(el){
var id1='thecode'+el;
var codebox=document.getElementById(id1);
var scheight = codebox.scrollHeight +10;
if (txttype=='opera') {
    codebox.style.height='100%';}
else if (txttype=='ie') {
    codebox.style.height=scheight+'px';
    codebox.style.overflowX='auto';
    codebox.style.overflowY='auto';}
else {
codebox.style.height=scheight+'px';
codebox.style.overflow='visible';}
}

function contract(el){
var id1='thecode'+el;
var codebox=document.getElementById(id1);
codebox.style.height=45+'px';
codebox.style.overflow='auto';
}

// code selector
function selectCode(el){
var codebox=eval('document.selectcode'+el+'.thecode'+el);
codebox.focus();
codebox.select();
}
function dohelp(){
// Help Code Popup
var doPopUpHelpCodeX = (screen.width/2)-110;
var doPopUpHelpCodeY = (screen.height/2)-150;
var pos = "left="+doPopUpHelpCodeX+",top="+doPopUpHelpCodeY;
doPopUpHelpCodeWindow = window.open("includes/code_help.asp","HelpCode","width=220,height=325,"+pos);
}
// ------------------ end codebox code
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();
arrItems1[0] = js_none;
arrItemsGrp1[0] = 1;
arrItems1[1] = js_member;
arrItemsGrp1[1] = 1;
arrItems1[2] = js_admin;
arrItemsGrp1[2] = 1;
arrItems1[3] = js_member + " & " + js_admin;
arrItemsGrp1[3] = 1;
arrItems1[4] = js_member;
arrItemsGrp1[4] = 2;
arrItems1[5] = js_member + " & " + js_admin;
arrItemsGrp1[5] = 2;
arrItems1[6] = js_member;
arrItemsGrp1[6] = 3;
arrItems1[7] = js_member;
arrItemsGrp1[7] = 4;

function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
  var myEle;
  var x;
  // Empty the second drop down box of any choices
  for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
  // ADD Default Choice - in case there are no values
  myEle = document.createElement("option");
  myEle.value = 0;
  myEle.text = "[SELECT]";
  controlToPopulate.add(myEle);
  
  for ( x = 0 ; x < ItemArray.length  ; x++ )
    {
      if ( GroupArray[x] == control.value )
        {
          myEle = document.createElement("option");
          myEle.value = x+1;
          myEle.text = ItemArray[x];
          controlToPopulate.add(myEle);
        }
    }
}

//var maxWidth=100;
//var maxHeight=100;
var maxWidth;
var maxHeight;
var fileTypes=["bmp","gif","png","jpg","jpeg"];
var outImage="previewField";
var defaultPic="images/spacer.gif";

function preview(what,mwid,mhgt){
  maxWidth=mwid;
  maxHeight=mhgt;
  var source=what.value;
  var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
  for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
  globalPic=new Image();
  if (i<fileTypes.length) globalPic.src=source;
  else {
    globalPic.src=defaultPic;
    alert("THAT IS NOT A VALID IMAGE\nPlease load an image with a valid extention");
  }
  setTimeout("applyChanges()",200);
}
var globalPic;
function applyChanges(){
  var field=document.getElementById(outImage);
  var x=parseInt(globalPic.width);
  var y=parseInt(globalPic.height);
  if (x>maxWidth) {
    y*=maxWidth/x;
    x=maxWidth;
  }
  if (y>maxHeight) {
    x*=maxHeight/y;
    y=maxHeight;
  }
  field.style.display=(x<1 || y<1)?"none":"";
  field.src=globalPic.src;
  field.width=x;
  field.height=y;
}

function openWindow(url) {
  popupWin = window.open(url,'new_page','width=400,height=400');
}
function openWindow2(url) {
  popupWin = window.open(url,'new_page','width=400,height=480');
}
function openWindow3(url) {
  popupWin = window.open(url,'new_page','width=400,height=450,scrollbars=yes');
}
function openWindow4(url) {
  popupWin = window.open(url,'new_page','width=400,height=525');
}
function openWindow5(url) {
  popupWin = window.open(url,'new_page','width=450,height=525,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes');
}
function openWindow6(url) {
  popupWin = window.open(url,'new_page','width=550,height=525,scrollbars=yes,resizable=yes');
}
function openWindowCT(url) {
  popupWin = window.open(url,'new_page','width=450,height=480');
}
function openWindowPM(url) {
  popupWin = window.open(url,'pm_pop_send','resizable,width=635,height=550,top=30,left=120,scrollbars=yes')
}
function openWindowPager(url) {
  popupWin = window.open(url,'pager','resizable,width=210,height=310,left=10,top=75,scrollbars=auto')
}
var popwin = null;
function popUpWind(mypage,myname,w,h,scr,resiz){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scr+',toolbar=no,resizable='+resiz+',menubar=no'
popwin = window.open(mypage,myname,settings)
}
// onclick="popUpWind('default.asp','name','400','400','yes','yes');return false"
//  End -->