var ns  = (document.layers)? true:false; 
var ie4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true:false;
var ie5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true:false;
var ie6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true:false;
var ie = ie4 || ie5 || ie6;
var dom = (document.getElementById) ? true:false;
var splashWin = null;
isLoaded = false;
denumire_categorie = "";




//Hide status bar msg II script- by javascriptkit.com
//Visit JavaScript Kit (http://javascriptkit.com) for script
//Credit must stay intact for use



if (document.layers)document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)



document.onmouseover=hidestatus
document.onmouseout=hidestatus
document.onmousedown=hidestatus
document.onmouseup=hidestatus
document.onmouseclick=hidestatus





function hidestatus(){
//window.status='Layouts4Myspace'
return true
}



function emailimagine(imagine){
   work = "emailimagine.php?CODIMAGINE="+imagine+"&amp;CATEGORIE="+denumire_categorie;  
   window.open(work,'email', config='height=650,width=800, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no')
}

function pushimages() {

      for (var i=0; i<document.images.length; i++) {
        if (!document.images[i].complete) {
            document.images[i].src = document.images[i].src;
        }
      }

}

function _homepg(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}


function  homepg(){
    _homepg("Layouts4myspace - myspace layouts & backgrounds", "http://www.layouts4myspace.info/");
}


function init(){
    isLoaded = true;
	pushimages();
}


function zwindow(source,name,width,height,nHow)
{
  /*
  nHow == 0 - centered;
  nHow == 1 - up left
  */
  var screenWidth,screenHeight,splashWin; 
  screenWidth  = screen.availWidth;
  screenHeight = screen.availHeight;  
  if(nHow == 0)
  {
    if(ie||dom) { splashWin = window.open(source,name, "width="+width+",height="+height+",left="+(screenWidth-width)/2+",top="+(screenHeight-height)/2+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0" ); }
    if(ns) { splashWin = window.open(source,name, "width="+width+",height="+height+",screenX="+(screenWidth-width)/2+",screenY="+(screenHeight-height)/2+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0" ); }
  }
  if(nHow == 1)
  {
    if(ie||dom) { splashWin = window.open(source,name, "width="+width+",height="+height+",left=7,top=18,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0" ); }
    if(ns) { splashWin = window.open(source,name, "width="+width+",height="+height+",screenX=0,screenY=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0" ); }
  }
  
}


function hi5form(categorie, id_wallpaper){
	myhref = "http://layouts4myspace.info/hi5layout.php?ID="+id_wallpaper+"&CATEGORIE="+categorie;
    document.location.href=myhref;

}

function previewlayout(id){
		 window.open("http://layouts4myspace.info/layout_preview_by_id.php?id="+id, "mylayout");

}

function morelayout(categorie){
	myhref = "http://layouts4myspace.info/mylt.php?categorie="+categorie;
    document.location.href=myhref;

}


function showloadcode(idloadcode){
	document.getElementById(idloadcode).style.display="block";
	//alert("in testing...");

}

function hideloadcode(idloadcode){
	document.getElementById(idloadcode).style.display="none";

}


function mylogin(idform){
	f1 = "trim(document."+idform+".myname.value)";
	f2 = "trim(document."+idform+".mypass.value)";
	f3 = "document."+idform+".submit()";

	if ( ( eval(f1) != '') && (eval(f2) != '') )
	{
		  eval(f3);
	}
	else{
		alert('please enter data for both fields name and password !');
	}
		 
} 

function myregister(){
	document.location.href= "register.php";
}
