function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;


//Checks if the supplied fields are empty and highlights field in red if so
function ContactFormValidation (sFieldIDs) {
	var i;
	var arrFields = sFieldIDs.split(":");
	var currField;
	var borderstyle = "1px solid #4b3730";
	var bgcolorstyle = "#eadecc";
	var bSubmitForm = true;
	
	for (i = 0; i < arrFields.length; i++) {
		// Get form field reference
		currField = document.getElementById(arrFields[i]);
		
		// Set fields style to default
		SetBorderStyle(currField, "default");
		
		// If field is empty then set the style to red background and border
		if (currField.value == "") {
			SetBorderStyle(currField, "error");
			bSubmitForm = false;
		}
	}
	return bSubmitForm;
}
function SetBorderStyle(fldFormField, fDefaultOrError){
	if (fDefaultOrError.toLowerCase() == "error") {
		borderstyle = "1px solid #4b3730";
		bgcolorstyle = "#eadecc";
	}
	else if (fDefaultOrError.toLowerCase() == "default") {
		borderstyle = "1px solid #969696";
		bgcolorstyle = "#FFFFFF";
	}
	
	fldFormField.style.border = borderstyle;
	fldFormField.style.background = bgcolorstyle;
}



function highlightTab(obj){
	obj.style.backgroundImage="url(images/tab_1px_on.gif)";
}
function unHighlightTab(obj){
	obj.style.backgroundImage="url(images/tab_1px_off.gif)";
}

/* AJAX functions to help with innerpage navigation */
function getXMLHTTP() { //fuction to return the xml http object
	var xmlhttp=false;
	try{
		xmlhttp=new XMLHttpRequest();
	}
	catch(e){
		try{
			xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(e){
			try{
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e1){
				xmlhttp=false;
			}
		}
	}
	
	return xmlhttp;
}

function getProfilePage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
          document.getElementById('ajaxcontent').innerHTML=req.responseText;
          changeProfileTabs(selected_tab);
        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function getAlbumPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
          document.getElementById('ajaxcontent').innerHTML=req.responseText;
          changePhotoTabs(selected_tab);
          if(page.indexOf("ajax_editalbum.php")!=-1){
          	var table = document.getElementById('table-2');
						var tableDnD = new TableDnD();
						tableDnD.init(table);
          }
          delete req;
        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}

function getVideoPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeVideoTabs(selected_tab);

        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}

function getJournalPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeJournalTabs(selected_tab);
					if(selected_tab=='manage_tab' || selected_tab=='add_tab'){
						try{
							generate_wysiwyg('body');
						}catch(err){}
					}
        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function getRatingsPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeRatingsTabs(selected_tab);

        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function getMessagePage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeMessageTabs(selected_tab);
					if(selected_tab=="compose_tab"){
						new Ajax.Autocompleter("toUser","droptitle_en","ajax_populate_compose.php");
					}

        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function getFriendsPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeFriendsTabs(selected_tab);

        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function getGroupsPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeGroupsTabs(selected_tab);

        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}

function getTrophyPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeTrophyTabs(selected_tab);

        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function groupphotoGalChange(gal){
  var strURL="ajax_groupphoto_add.php?gal="+gal;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajax_content').innerHTML=req.responseText;
        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function getArticlesPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeArticlesTabs(selected_tab);
					if(selected_tab=='addarticles_tab'){
						generate_wysiwyg('body');
					}
        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}
function getSummaryPage(page, selected_tab){
  var strURL=page;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
					changeSummaryTabs(selected_tab);

        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}

function changeProfileTabs(selected_tab){
	var profiletab=document.getElementById("profile_tab");
	var basictab=document.getElementById("basic_tab");
	var contacttab=document.getElementById("contact_tab");
	var personaltab=document.getElementById("personal_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	profiletab.className="tab_unselected";
	profiletab.onmouseover=function(){highlightTab(this);}
	profiletab.onmouseout=function(){unHighlightTab(this);}
	
	basictab.className="tab_unselected";
	basictab.onmouseover=function(){highlightTab(this);}
	basictab.onmouseout=function(){unHighlightTab(this);}

	contacttab.className="tab_unselected";
	contacttab.onmouseover=function(){highlightTab(this);}
	contacttab.onmouseout=function(){unHighlightTab(this);}

	personaltab.className="tab_unselected";
	personaltab.onmouseover=function(){highlightTab(this);}
	personaltab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}

}
function changePhotoTabs(selected_tab){
	var profiletab=document.getElementById("overview_tab");
	var basictab=document.getElementById("add_tab");
	var managetab=document.getElementById("manage_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	profiletab.className="tab_unselected";
	profiletab.onmouseover=function(){highlightTab(this);}
	profiletab.onmouseout=function(){unHighlightTab(this);}
	
	basictab.className="tab_unselected";
	basictab.onmouseover=function(){highlightTab(this);}
	basictab.onmouseout=function(){unHighlightTab(this);}
	
	managetab.className="tab_unselected";
	managetab.onmouseover=function(){highlightTab(this);}
	managetab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}

}
function changeVideoTabs(selected_tab){
	var profiletab=document.getElementById("overview_tab");
	var basictab=document.getElementById("manage_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	profiletab.className="tab_unselected";
	profiletab.onmouseover=function(){highlightTab(this);}
	profiletab.onmouseout=function(){unHighlightTab(this);}
	
	basictab.className="tab_unselected";
	basictab.onmouseover=function(){highlightTab(this);}
	basictab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeJournalTabs(selected_tab){
	var profiletab=document.getElementById("overview_tab");
	var basictab=document.getElementById("manage_tab");
	var addtab=document.getElementById("add_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	profiletab.className="tab_unselected";
	profiletab.onmouseover=function(){highlightTab(this);}
	profiletab.onmouseout=function(){unHighlightTab(this);}
	
	basictab.className="tab_unselected";
	basictab.onmouseover=function(){highlightTab(this);}
	basictab.onmouseout=function(){unHighlightTab(this);}
	
	addtab.className="tab_unselected";
	addtab.onmouseover=function(){highlightTab(this);}
	addtab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeRatingsTabs(selected_tab){
	var profiletab=document.getElementById("overview_tab");
	var basictab=document.getElementById("manage_tab");
	var addtab=document.getElementById("add_tab");
	var selectedtab=document.getElementById(selected_tab);
	
	//profiletab.className="tab_selected";
	profiletab.className="tab_unselected";
	profiletab.onmouseover=function(){highlightTab(this);}
	profiletab.onmouseout=function(){unHighlightTab(this);}
	
	basictab.className="tab_unselected";
	basictab.onmouseover=function(){highlightTab(this);}
	basictab.onmouseout=function(){unHighlightTab(this);}
	
	addtab.className="tab_unselected";
	addtab.onmouseover=function(){highlightTab(this);}
	addtab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeMessageTabs(selected_tab){
	var inboxtab=document.getElementById("inbox_tab");
	var composetab=document.getElementById("compose_tab");
	var senttab=document.getElementById("sent_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	inboxtab.className="tab_unselected";
	inboxtab.onmouseover=function(){highlightTab(this);}
	inboxtab.onmouseout=function(){unHighlightTab(this);}
	
	composetab.className="tab_unselected";
	composetab.onmouseover=function(){highlightTab(this);}
	composetab.onmouseout=function(){unHighlightTab(this);}

	senttab.className="tab_unselected";
	senttab.onmouseover=function(){highlightTab(this);}
	senttab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeFriendsTabs(selected_tab){
	var inboxtab=document.getElementById("view_tab");
	var composetab=document.getElementById("find_tab");
	var senttab=document.getElementById("invite_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	inboxtab.className="tab_unselected";
	inboxtab.onmouseover=function(){highlightTab(this);}
	inboxtab.onmouseout=function(){unHighlightTab(this);}
	
	composetab.className="tab_unselected";
	composetab.onmouseover=function(){highlightTab(this);}
	composetab.onmouseout=function(){unHighlightTab(this);}

	senttab.className="tab_unselected";
	senttab.onmouseover=function(){highlightTab(this);}
	senttab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeGroupsTabs(selected_tab){
	var inboxtab=document.getElementById("view_tab");
	var composetab=document.getElementById("search_tab");
	var senttab=document.getElementById("mygroups_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	inboxtab.className="tab_unselected";
	inboxtab.onmouseover=function(){highlightTab(this);}
	inboxtab.onmouseout=function(){unHighlightTab(this);}
	
	composetab.className="tab_unselected";
	composetab.onmouseover=function(){highlightTab(this);}
	composetab.onmouseout=function(){unHighlightTab(this);}

	senttab.className="tab_unselected";
	senttab.onmouseover=function(){highlightTab(this);}
	senttab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeTrophyTabs(selected_tab){
	var inboxtab=document.getElementById("approve_tab");
	var composetab=document.getElementById("hunting_tab");
	var senttab=document.getElementById("fishing_tab");
	var outtab=document.getElementById("outdoors_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	inboxtab.className="tab_unselected";
	inboxtab.onmouseover=function(){highlightTab(this);}
	inboxtab.onmouseout=function(){unHighlightTab(this);}
	
	composetab.className="tab_unselected";
	composetab.onmouseover=function(){highlightTab(this);}
	composetab.onmouseout=function(){unHighlightTab(this);}

	senttab.className="tab_unselected";
	senttab.onmouseover=function(){highlightTab(this);}
	senttab.onmouseout=function(){unHighlightTab(this);}
	
	outtab.className="tab_unselected";
	outtab.onmouseover=function(){highlightTab(this);}
	outtab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeArticlesTabs(selected_tab){
	var inboxtab=document.getElementById("articles_tab");
	var composetab=document.getElementById("rss_tab");
	var addarticletab=document.getElementById("addarticles_tab");
	var addrsstab=document.getElementById("addrss_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	inboxtab.className="tab_unselected";
	inboxtab.onmouseover=function(){highlightTab(this);}
	inboxtab.onmouseout=function(){unHighlightTab(this);}
	
	composetab.className="tab_unselected";
	composetab.onmouseover=function(){highlightTab(this);}
	composetab.onmouseout=function(){unHighlightTab(this);}

	addrsstab.className="tab_unselected";
	addrsstab.onmouseover=function(){highlightTab(this);}
	addrsstab.onmouseout=function(){unHighlightTab(this);}
	
	addarticletab.className="tab_unselected";
	addarticletab.onmouseover=function(){highlightTab(this);}
	addarticletab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function changeSummaryTabs(selected_tab){
	var inboxtab=document.getElementById("summary_tab");
	var composetab=document.getElementById("trophy_tab");
	var senttab=document.getElementById("video_tab");
	var outtab=document.getElementById("articles_tab");
	var selectedtab=document.getElementById(selected_tab);
	//profiletab.className="tab_selected";
	inboxtab.className="tab_unselected";
	inboxtab.onmouseover=function(){highlightTab(this);}
	inboxtab.onmouseout=function(){unHighlightTab(this);}
	
	composetab.className="tab_unselected";
	composetab.onmouseover=function(){highlightTab(this);}
	composetab.onmouseout=function(){unHighlightTab(this);}

	senttab.className="tab_unselected";
	senttab.onmouseover=function(){highlightTab(this);}
	senttab.onmouseout=function(){unHighlightTab(this);}
	
	outtab.className="tab_unselected";
	outtab.onmouseover=function(){highlightTab(this);}
	outtab.onmouseout=function(){unHighlightTab(this);}

	selectedtab.style.backgroundImage="";	
	selectedtab.className="tab_selected";
	selectedtab.onmouseover=function(){}
	selectedtab.onmouseout=function(){}
}

function setPrivate(field, lockobj){
	var strURL="updatePrivateSettings.php?field="+field;
  var req = getXMLHTTP();
  if (req)
  {
    req.onreadystatechange = function()
    {
      if (req.readyState == 4) // only if “OK”
      {
        if (req.status == 200)
        {
        	//alert(lockobj.src);
          if(req.responseText=="privitized"){
          	lockobj.src='images/icon_locked.gif';
          	lockobj.onmouseover=function(){this.src='images/icon_unlocked.gif';};
          	lockobj.onmouseout=function(){this.src='images/icon_locked.gif';};
          }
          else if(req.responseText=="unprivatized"){
          	lockobj.src='images/icon_unlocked.gif';    
			lockobj.onmouseover=function(){this.src='images/icon_locked.gif';};
			lockobj.onmouseout=function(){this.src='images/icon_unlocked.gif';};
          }
        } else {
          alert("There was a problem while using XMLHTTP:\n" + req.statusText);
        }
      }
    }
    req.open("GET", strURL, true);
    req.send(null);
  }
}

function launchProfilePicWindow(){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 313) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('multiFileUploader.php?limit=1&purpose=profile_pic&width=163&callback=addprofile','FileUploader','directories=0,height=313,width=540,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0,status=0'+winParms);
}
function launchProfilePicWindowA(user){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 313) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('multiFileUploader.php?limit=1&purpose=profile_pic&width=163&callback=addprofile&user='+user,'FileUploader','directories=0,height=313,width=540,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0,status=0'+winParms);
}
function launchGroupPicWindow(){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 313) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('multiFileUploader.php?limit=1&purpose=group_pic&width=163&callback=addgroup&gal='+document.getElementById("hiddenidpresave").value,'FileUploader','directories=0,height=313,width=540,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0,status=0'+winParms);
}
function launchGearPicWindow(){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 313) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('multiFileUploader.php?limit=1&purpose=gear_pic&width=163&callback=addgear&gal='+document.getElementById("hiddenidpresave").value,'FileUploader','directories=0,height=313,width=540,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0,status=0'+winParms);
}
function launchOutfitterPicWindow(){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 313) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('multiFileUploader.php?limit=1&purpose=outfitter_pic&width=163&callback=addoutfitter&gal='+document.getElementById("hiddenidpresave").value,'FileUploader','directories=0,height=313,width=540,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0,status=0'+winParms);
}
function launchGroupPhotoWindow(group){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 313) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('groupPhotoUpload.php?group='+group,'FileUploader','directories=0,height=313,width=540,location=0,menubar=0,resizable=0,scrollbars=1,toolbar=0,status=0'+winParms);
}
function launchGroupVideoWindow(group){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 313) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('groupVideoUpload.php?group='+group,'FileUploader','directories=0,height=313,width=540,location=0,menubar=0,resizable=0,scrollbars=1,toolbar=0,status=0'+winParms);
}

function launchAlbumWindow(gallery){
	var left = Math.floor( (screen.width - 540) / 2);
	var top = Math.floor( (screen.height - 626) / 2);
	var winParms = ",top=" + top + ",left=" + left;
	newwindowref=window.open('multiFileUploader.php?gal='+gallery+'&limit=10&purpose=gallery&width=650&callback=addgallery','FileUploader','directories=0,height=626,width=540,location=0,menubar=0,resizable=0,scrollbars=0,toolbar=0,status=0'+winParms);
}
function removeProfilePic(){
	var strURL="removeprofilepic.php";
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					document.getElementById("profile_pic_preview").innerHTML="&nbsp;";
					document.getElementById("removePicControl").style.display="none";
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removeGroupPic(){
	var group=document.getElementById("hiddenidpresave").value;
	var strURL="removegrouppic.php?group="+group;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					document.getElementById("profile_pic_preview").innerHTML="&nbsp;";
					document.getElementById("removePicControl").style.display="none";
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removeGearPic(){
	var group=document.getElementById("hiddenidpresave").value;
	var strURL="removegearpic.php?gear="+group;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					document.getElementById("profile_pic_preview").innerHTML="&nbsp;";
					document.getElementById("removePicControl").style.display="none";
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removeOutfitterPic(){
	var group=document.getElementById("hiddenidpresave").value;
	var strURL="removeoutfitterpic.php?gear="+group;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					document.getElementById("profile_pic_preview").innerHTML="&nbsp;";
					document.getElementById("removePicControl").style.display="none";
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function addprofile(addedfileName){
	document.getElementById("profile_pic_preview").innerHTML="<img src='profileimages/"+addedfileName+"' border=0 alt=''>";
	document.getElementById("removePicControl").style.display="block";
}
function addgroup(addedfileName, savedid){
	document.getElementById("hiddenidpresave").value=savedid;
	document.getElementById("profile_pic_preview").innerHTML="<img src='groupimages/"+addedfileName+"' border=0 alt=''>";
	document.getElementById("removePicControl").style.display="block";
}
function addgear(addedfileName, savedid){
	document.getElementById("hiddenidpresave").value=savedid;
	document.getElementById("profile_pic_preview").innerHTML="<img src='gearimages/"+addedfileName+"' border=0 alt=''>";
	document.getElementById("removePicControl").style.display="block";
}
function addoutfitter(addedfileName, savedid){
	document.getElementById("hiddenidpresave").value=savedid;
	document.getElementById("profile_pic_preview").innerHTML="<img src='outfitterimages/"+addedfileName+"' border=0 alt=''>";
	document.getElementById("removePicControl").style.display="block";
}
function addgallery(gallery){
	parent.getAlbumPage('ajax_editalbum.php?gal='+gallery,'add_tab');
}
function addgroupphoto(gallery){
	parent.getGroupsPage('ajax_groups_groupphotos.php?group='+gallery,'view_tab');
}

function saveOrder(orderStr){
	var strURL="savephotoOrder.php?order="+orderStr;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{

				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}

function saveCover(radioObj){
	var strURL="saveCoverPhoto.php?cover="+radioObj.value;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}

function removePhoto(photoRemoval){
	var strURL="removeAlbumPhoto.php?photo="+photoRemoval;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					document.getElementById('ajaxcontent').innerHTML=req.responseText;
          //changePhotoTabs(selected_tab);
          //if(page.indexOf("ajax_editalbum.php")!=-1){
          	var table = document.getElementById('table-2');
						var tableDnD = new TableDnD();
						tableDnD.init(table);
          //}
          delete req;
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}

function saveCaption(textObj){
	var savevalue=textObj.value;
	savevalue=savevalue.replace(/\r\n/g,'\n');
	savevalue=savevalue.replace(/\n/g,'<br>');
	savevalue=unescape(savevalue);
	savevalue=savevalue.replace('&','&amp;');


	var strURL="savePhotoCaption.php?photoCaption="+textObj.id+"&caption="+escape(savevalue);
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removealbum(album){
	var strURL="removealbum.php?album="+album;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getAlbumPage("ajax_photo_over.php", "overview_tab");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removevideo(album){
	var strURL="removevideo.php?vid="+album;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getVideoPage("ajax_video_over.php", "overview_tab");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removeJournal(entry){
	var strURL="removeJournal.php?entry="+entry;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getJournalPage("ajax_journal_manage.php", "manage_tab");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removeRating(entry){
	var strURL="removeRating.php?entry="+entry;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getRatingsPage("ajax_ratings_manage.php", "manage_tab");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}

function clearstars(stopat){
	var idStar=0.5;
	var stopid=Number(stopat);
	for(var i=5; i > stopid; i-=0.5){
		document.getElementById(i).style.visibility='hidden';
	}
}

function selectstars(stopat){
	clearstars(0);
	var stopid=Number(stopat);
	for(var i=0.5; i <= stopid; i+=0.5){
		document.getElementById(i).style.visibility='visible';
	}
}
function resetstars(limit){
	selectstars(limit);
}
function setStarsto(limit){
	document.getElementById('ratingvalue').value=limit;
	selectstars(limit);
}

function addfriend(friend){
	var strURL="addFriend.php?user="+friend;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					alert(req.responseText +" has been added to your friends list.");
					document.hiddenResubmit.submit();
					
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function addfriend_silent(friend){
	var strURL="addFriend.php?user="+friend;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					//alert(req.responseText +" has been added to your friends list.");
					//document.hiddenResubmit.submit();					
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function addfriend_nore(friend){
	var strURL="addFriend.php?user="+friend;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					alert(req.responseText +" has been added to your friends list.");
					//document.hiddenResubmit.submit();					
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removefriend(friend){
	var strURL="removeFriend.php?user="+friend;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					alert(req.responseText +" has been removed from your friends list.");
					document.hiddenResubmit.submit();
					
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function removefriend2(friend){
	var strURL="removeFriend.php?user="+friend;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					alert(req.responseText +" has been removed from your friends list.");
					getFriendsPage("ajax_friends_view.php", "view_tab");
					
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}

function removegroup(entry){
	var strURL="removeGroup.php?entry="+entry;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getGroupsPage("ajax_groups_mine.php", "mygroups_tab");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function leavegroup(entry){
	var strURL="removeGroupMember.php?entry="+entry;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getGroupsPage("ajax_groups_view.php", "view_tab");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function joingroup(entry){
	var strURL="addGroupMember.php?entry="+entry;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getGroupsPage("ajax_groups_view.php", "view_tab");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function leavegroup_ovr(entry){
	var strURL="removeGroupMember.php?entry="+entry;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					var templocation=window.location.href;
					window.location.href=templocation;
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function joingroup_ovr(entry){
	var strURL="addGroupMember.php?entry="+entry;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					var templocation=window.location.href;
					window.location.href=templocation;
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function submitTrophy(whichPhoto){
	var strURL="submitTrophy.php?entry="+whichPhoto;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					document.getElementById("submitTrophy"+req.responseText).disabled=true;
					alert("Your photo has been submitted for consideration into the Trophy Room.");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function submitFeature(whichPhoto){
	var strURL="submitFeature.php?entry="+whichPhoto;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					alert("Your video has been submitted for consideration into the Featured Videos.");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function approveTrophy(whichPhoto){
	var section=document.getElementById("sectiondrop"+whichPhoto).options[document.getElementById("sectiondrop"+whichPhoto).selectedIndex].value;
	var strURL="approveTrophy.php?entry="+whichPhoto+"&section="+section;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getTrophyPage('ajax_trophy_approve.php','approve_tab');
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function moveTrophy(whichPhoto){
	var section=document.getElementById("sectiondrop"+whichPhoto).options[document.getElementById("sectiondrop"+whichPhoto).selectedIndex].value;
	var strURL="approveTrophy.php?entry="+whichPhoto+"&section="+section;
	
	//alert(section + "\n" + strURL);
	
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					//alert('ajax_trophy_'+req.responseText+'.php' + ' - ' + req.responseText+'_tab');
					getTrophyPage('ajax_trophy_'+req.responseText+'.php',req.responseText+'_tab');
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function movefeature(whichPhoto){
	var section=document.getElementById("sectiondrop"+whichPhoto).options[document.getElementById("sectiondrop"+whichPhoto).selectedIndex].value;
	var strURL="approveFeature.php?entry="+whichPhoto+"&section="+section;
	
	//alert(section + "\n" + strURL);
	
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					//alert('ajax_trophy_'+req.responseText+'.php' + ' - ' + req.responseText+'_tab');
					getTrophyPage('ajax_feature_'+req.responseText+'.php',req.responseText+'_tab');
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function rejectTrophy(whichPhoto){
	var strURL="removeTrophy.php?entry="+whichPhoto;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getTrophyPage('ajax_trophy_approve.php','approve_tab');
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function rejectvideo(whichPhoto){
	var strURL="removeFeature.php?entry="+whichPhoto;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					getTrophyPage('ajax_feature_approve.php','approve_tab');
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function primefeaturevideo(videoid, videosrc){
	var fo = new SWFObject(
	"FlowPlayerlight.swf", "FlowPlayer", "196", "163", "9", "#fff", true
  );
  fo.addVariable("config", "{ countryCode: 'fi', playList: [ {overlayId: 'play' }, { url: 'http://www.newoutdoorsmen.com/videos/"+videosrc+"' } ], initialScale: 'orig', loop: false, autoPlay: true, autoBuffering:true, usePlayOverlay:true,showScrubber:true,showMenu:false,showFullScreenButton:false}");
  fo.write("playerContainer"+videoid);
}
function submitVideo(whichVid){
	var strURL="submitVideo.php?entry="+whichVid;
	var req = getXMLHTTP();
	if (req)
	{
		req.onreadystatechange = function()
		{
			if (req.readyState == 4) // only if “OK”
			{
				if (req.status == 200)
				{
					alert("Your photo has been submitted for consideration into the Trophy Room");
				}
				else {
					alert("There was a problem while using XMLHTTP:\n" + req.statusText);
				}
			}
		}
		req.open("GET", strURL, true);
		req.send(null);
	}
}
function checkSelected(frmThisForm) {
	var bDelete = false;
	frmThisForm = frmThisForm.elements;
	
	for (i = 0; i < frmThisForm.length; i++) {
		if (frmThisForm[i].type == "checkbox" && frmThisForm[i].checked) {
			bDelete = true;
			break;
		}
	}
	return bDelete;
}
function validateEmail (frmThisForm, sEmail) {
	var email = /^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/;
	
	if (email.test(sEmail.value)) {
		frmThisForm.submit();
	}
	else {
		alert("Please enter a valid e-mail address.");
	}
}