isLoaded = false;
denumire_categorie = "";
function emailimagine(imagine){
   work = "emailimagine.php?CODIMAGINE="+imagine+"&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 _bk(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}


function bk(){
    _bk("Layouts4Myspace - layouts for myspace", "http://www.layouts4myspace.info");
}


function init(){
    pushimages();
    isLoaded = true;
}


function submitOpinie(id_categorie,id_wallpaper,categorie){
      ok = true;
      comentariu = trim(document.getElementById("SHOWAREA").value);
      nume       = trim(document.getElementById("SHOWZONE").value);     
      if(nume == "")ok = false;
      if(comentariu == "")ok = false;
      if ( (nume.toLowerCase()).indexOf("your name here") >= 0 )ok = false;
      if ( (comentariu.toLowerCase()).indexOf("your comment here") >= 0 )ok = false;
      if(ok){
          nume = escape(nume);
          comentariu = escape(comentariu);
          SHOW.document.location.href = "_showcat.php?ID_CATEGORIE="+id_categorie+"&ID_WALLPAPER="+id_wallpaper+"&COMENTARIU="+comentariu+"&NUME="+nume+"&CATEGORIE="+categorie; 
      }
      else{
         alert("Please consider entering data for both fields  !");
      } 
}



function resetOpinie(){
     document.getElementById("SHOWZONE").value = "your name here";
     document.getElementById("SHOWAREA").value = "your comment here";
     SHOW.document.location.href = "_showcat.php";
}




function submitOpinieMySpace(){
      ok = true;
      comentariu = trim(document.getElementById("SHOWAREA").value);
      nume       = trim(document.getElementById("SHOWZONE").value);     
      if(nume == "")ok = false;
      if(comentariu == "")ok = false;
      if ( (nume.toLowerCase()).indexOf("your name here") >= 0 )ok = false;
      if ( (comentariu.toLowerCase()).indexOf("your comment here") >= 0 )ok = false;
      if(ok){
          nume = escape(nume);
          comentariu = escape(comentariu);
          SHOW.document.location.href = "_showlayout.php?&ACTION=1&COMENTARIU="+comentariu+"&NUME="+nume;
      }
      else{
         alert("Please consider entering data for both fields  !");
      } 
}


function resetOpinieMySpace(reset_zone){
     document.getElementById("SHOWZONE").value = "your name here";
     document.getElementById("SHOWAREA").value = "your comment here";
	 if(reset_zone == 1){
         SHOW.document.location.href = "_showlayout.php";
	 }
}



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 moreOps(){
	/*
	 * more opinions
	 */
	 alert("coming soon...");
	 //document.location.href = "_showops.php?ID_CATEGORIE="+id_categorie;
}


function hi5form(categorie, id_wallpaper){
	myhref = "http://www.layouts4myspace.info/hi5layout.php?ID="+id_wallpaper+"&CATEGORIE="+categorie;
    document.location.href=myhref;

}

