function submitform(formname,to)
{
	document.forms[formname].action=to;
  	document.forms[formname].submit();
}

function returnObjById( id ) 
{ 
    if (document.getElementById(id)!=null) 
        var returnVar = document.getElementById(id); 
    else if (document.all[id]!=null) 
        var returnVar = document.all[id]; 
    else if (document.layers[id]!=null) 
        var returnVar = document.layers[id]; 
	//else
		//var returnVar=document.forms['order'].getElementById(id); 
		
    return returnVar; 
}

function popWindow(pic_name, width, height,root) { 

var theURL= root+"general/album/photoview.php?photo_name=" + pic_name;
photoWindow = window.open(theURL,"photowindow",'toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=' + width + ',height=' + height);
photoWindow.moveTo(0,0);
photoWindow.focus();
photoWindow.opener = top;


}

function popLikeWindow(pic_name,root) { 
var theURL= root+"general/likeit.php?photo_name=" + pic_name;
photoLikeWindow = window.open(theURL,"photoLikeWindow",'toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=200px,height=200px');
photoLikeWindow.moveTo(250,250);
photoLikeWindow.focus();
}

function popLoginWindow(page_name) { 
var theURL= "login.php?page_name=" + page_name;
var width = 275;
var height= 275;
 window.open(theURL,"loginWindow",'status=1,scrollbars=0,width=' + width + ',height=' + height + ',resizable=0');
//photoWindow.moveTo(0,0);
//photoWindow.focus();
//photoWindow.opener = top;
}


function popDisLikeWindow(pic_name,root) { 
var theURL= root+"general/dislikeit.php?photo_name=" + pic_name;
photoLikeWindow = window.open(theURL,"photoLikeWindow",'toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=200px,height=200px');
photoLikeWindow.moveTo(250,250);
photoLikeWindow.focus();
}

function load(file,target) {
    if (target != '') {
        target.top.window.location.href = file;
		target.focus();
		window.close();
	} else {
        window.location.href = file;
	}
}
function close_window(){
	setTimeout ( window.close(), 30000 );
}




<!-- Dreamweaver image loader functions
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];}}
}

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];}
}
//-->


<!-- Copyright 2006,2007 Bontrager Connection, LLC
// http://bontragerconnection.com/ and http://www.willmaster.com/
// Version: July 28, 2007
var cX = 0; var cY = 0; var rX = 0; var rY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}
function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }
function AssignPosition(d) {
if(self.pageYOffset) {
	rX = self.pageXOffset;
	rY = self.pageYOffset;
	}
else if(document.documentElement && document.documentElement.scrollTop) {
	rX = document.documentElement.scrollLeft;
	rY = document.documentElement.scrollTop;
	}
else if(document.body) {
	rX = document.body.scrollLeft;
	rY = document.body.scrollTop;
	}
if(document.all) {
	cX += rX; 
	cY += rY;
	}
d.style.left = (cX+10) + "px";
d.style.top = (cY+10) + "px";
}
function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
dd.style.display = "block";
}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}

function alphanumeric(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}

function hasNumbers(t)
{
var regex = /\d/g;
return regex.test(t);
}


function setIframeHeight(iframeName) {
  //var iframeWin = window.frames[iframeName];
  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
  if (iframeEl) {
  iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
  //var docHt = getDocHeight(iframeWin.document);
  // need to add to height to be sure it will all show
  var h = alertSize();

  iframeEl.style.height = h + "px";
  //alertSize();
  }
}

function alertSize() {
	var myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	myHeight = document.body.clientHeight;
	}
	//window.alert( 'Height = ' + myHeight );
	return myHeight;
}
//-->
