myhref = document.location.href;
maxmediaid  = -1;
search  = null;
nrcomments = -1;



//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='Digital Advertising'
return true
}

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 loadtext(categorie,order,chunk){
		//document.location.href= "http://www.digital-advertising.ro/text/index.php?CATEGORIE="+categorie+"&ORDER="+order+"&CHUNK="+chunk; 
		document.location.href= "http://www.digital-advertising.ro/index.php?CATEGORIE="+categorie+"&ORDER="+order+"&CHUNK="+chunk; 
		
}


function loadtextcategorie(categorie,order){
   //document.location.href="http://www.digital-advertising.ro/text/index.php?CATEGORIE="+categorie+"&ORDER="+order;
   document.location.href="http://www.digital-advertising.ro/index.php?CATEGORIE="+categorie+"&ORDER="+order;
}


function continuetextsearch(search, order,chunk){
   //document.location.href="http://www.digital-advertising.ro/text/index.php?SEARCH="+search+"&ORDER="+order+"&CHUNK="+chunk;
   document.location.href="http://www.digital-advertising.ro/index.php?SEARCH="+search+"&ORDER="+order+"&CHUNK="+chunk;
}




function loadtagsearch(tag){  
			   wstring = "!"+tag+"!";
			   lsearch = "special1 like '"+wstring+"'";
			   document.location.href="http://www.digital-advertising.ro/text/index.php?SEARCH="+escape(lsearch);
}



function loadtextsearch(){  
   if( trim(document.getElementById("xsearch").value) == ""){
      alert("nu aţi introdus cuvânt de căutare");
   }
   else{
	      if ( document.getElementById("descriere").checked || document.getElementById("tags").checked){
			   wstring = "!"+document.getElementById("xsearch").value+"!";
			   if(document.getElementById("descriere").checked){
				  lsearch = "( descriere like '"+wstring+"' or cod like '"+wstring+"'";
			   }
			   else {
				  lsearch = "( 1!=1";
			   }
			   if(document.getElementById("tags").checked){
                  lsearch+=" or special1 like '"+wstring+"')";
			   }			  
               //document.location.href="http://www.digital-advertising.ro/text/index.php?SEARCH="+escape(lsearch);
			   document.location.href="http://www.digital-advertising.ro/index.php?SEARCH="+escape(lsearch);
	      }
		  else{
			  alert("bifaţi cel putin o locatie de cautare !");
		  }	      
   }
}


function markOrder(curent){
	if (orderparam==curent){
		document.write("<img src='../images/ok.jpg'>");
	}
	else{
        document.write("<img src='../images/ok_estompat.jpg'>");
	}

}





function showhidecomments(what, xdiv){
	   if(what=='show'){
		  document.getElementById(xdiv).style.display="block";
	   }
	   else{
		  if(what == 'hide'){ document.getElementById(xdiv).style.display="none"; }
	   }
}


function showhidesearch(what){
	   if(what=='show'){
		  document.getElementById("search_content").style.display="block";
	   }
	   else{
		  if(what == 'hide'){
			document.getElementById("search_content").style.display="none";
		  }
	   }
}


function sendcomentariu(id,f){
   xnume  = eval("document.xform"+f+".NUME.value");
   xmesaj = eval("document.xform"+f+".MESAJ.value");
   if ( typeof(xnume) == "string" && typeof(xmesaj) == "string" && trim(xnume) != "" && trim(xmesaj) != "" ){
		work = "document.xform"+f+".submit()";
		eval(work);
   }
   else{
        alert("Completează numele şi comentariul te rog...");
   }
}



function doRating(id,rate){
if( id != -1){

	if(rate == -1){ alert("selecteaza o nota, te rog..."); }
	else{		
		ratetarget.document.location.href = "http://www.digital-advertising.ro/_markrate.php?id="+id+"&rate="+rate;
		alert("multumesc pentru interes !");
		//location.reload();
	}
}
else { alert("aceasta categorie nu are informatii !");}
}



function sendcomentariu(id){
   xnume  = document.getElementById("nume").value;
   xmesaj = document.getElementById("mesaj").value;
   if ( trim(xnume) != "" && trim(xmesaj) != "" ){
		document.xform.submit();
   }
   else{
        alert("Completează numele şi comentariul te rog...");
   }
}


function init(){
    pushimages();
}

function showmediaimagine(id,order){
	document.location.href="http://www.digital-advertising.ro/imagini/show.php?MEDIAID="+id+"&ORDER="+order;

}

