isLoaded = false;
denumire_categorie = "";
function emailimagine(imagine,already_login){
	 if(already_login == 1){
          navigateWithReferrer( "emailimagine.php?CODIMAGINE="+imagine+"&CATEGORIE="+denumire_categorie);
	 }
	 else{
		 navigateWithReferrer( "http://www.3datadesign.com/gallery/eng/register.php");
	 }
}


function _bk(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}


function bk(){
    _bk("3DataDesign - digital art gallery,digital wallpapers", "http://www.3datadesign.com/");
}


function init(){
    isLoaded = true;
    pushimages();
	resetOpinie(1);
}


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(reset_zone){
     document.getElementById("SHOWZONE").value = "your name here";
     document.getElementById("SHOWAREA").value = "your comment here";
	 if(reset_zone == 1){
         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 navigateWithReferrer(url)
{
    var fakeLink = document.createElement ("a");
    if (typeof(fakeLink.click) == 'undefined')
        location.href = url;  // sends referrer in FF, not in IE
    else
    {
        fakeLink.href = url;
        document.body.appendChild(fakeLink);
        fakeLink.click();   // click() method defined in IE only
    }
}