
function View(form,txt) {
msg=open("","DisplayWindow","width=500,height=300,status=1,scrollbars=1");
msg.document.write("<html><head>");
msg.document.write("<title>UAP Admin - Text preview </title>");
msg.document.write("<link rel=\"stylesheet\" href=\"css/style.css\" type=\"text/css\">");
msg.document.write("<style>");
msg.document.write(" p {  text-align: justify} ")
msg.document.write("</style>");
msg.document.write("</head><body >");
msg.document.write("<table border=0><tr><td >");
msg.document.write("<p>");
msg.document.write(txt.value);
msg.document.write("</td></tr></table>");
msg.document.write("</body></html>");
}

function ViewTiny(form,txt) {
msg=open("","DisplayWindow","width=500,height=300,status=1,scrollbars=1");
msg.document.write("<html><head>");
msg.document.write("<title>UAP Admin - Text preview </title>");
msg.document.write("<link rel=\"stylesheet\" href=\"css/style.css\" type=\"text/css\">");
msg.document.write("<style>");
msg.document.write(" p {  text-align: justify} ")
msg.document.write("</style>");
msg.document.write("</head><body >");
msg.document.write("<table border=1 cellpadding=0 cellspacing=0 width=\"162\"><tr><td >");
msg.document.write(txt.value);
msg.document.write("</td></tr></table>");
msg.document.write("</body></html>");
}


function AddText(form, Action, txtelem){
var AddTxt="";
var txt="";
if(Action==1){  
txt=prompt("Enter text for HEADER1.","Text");      
if(txt!=null)           
AddTxt="<h1>"+txt+"</h1>\r\n";  
}
if(Action==2){  
txt=prompt("Enter text for HEADER2.","Text");      
if(txt!=null)           
AddTxt="<h2>"+txt+"</h2>\r\n";  
}
if(Action==3) AddTxt="&nbsp;";  
if(Action==4) {  
txt=prompt("Enter text for BOLD","Text");     
if(txt!=null)           
AddTxt="<b>"+txt+"</b>";        
}
if(Action==5) {  
txt=prompt("Enter text for ITALIC","Text");     
if(txt!=null)           
AddTxt="<i>"+txt+"</i>";        
}
if(Action==6) AddTxt="\r\n<p>";
if(Action==7) AddTxt="<BR>\r\n";
if(Action==8) AddTxt="<hr>\r\n";
if(Action==9) {  
txt=prompt("URL for link","http://");      
if(txt!=null){          
AddTxt="<a href="+txt+">";              
txt=prompt("Text for link","Text");              
AddTxt+=txt+"</a>\r\n";         
   }
}
if(Action==10) { 
txt=prompt("Image URL","URL");    
if(txt!=null)           
AddTxt="<img src="+txt+">\r\n"; 
}

txtelem.value+=AddTxt;
}

function OpenWin(address) {    
	var op_tool  =  0;    
	var op_loc_box  =  0;    
	var op_dir  =  0;    
	var op_stat  =  0;    
	var op_menu  =  0;    
	var op_scroll  =  1;    
	var op_resize  =  0;    
	var op_wid  = 360;   
	var op_heigh = 280;                 
	var option = "toolbar="+ op_tool +",location="+ op_loc_box +",directories=" 
+ op_dir +",status="+ op_stat +",menubar="+ op_menu +",scrollbars="  
+ op_scroll +",resizable="  + op_resize +",width=" + op_wid +",height="+ op_heigh +",left=100,top=100";
	var win3 = window.open("", "what_I_want", option);  
	var win4 = window.open(address, "what_I_want");
}

function MasiniPassText1(valoare) {
  document.forms[0].car_img1.value = valoare;
}



function usure ( message, url ) {
	arethey = confirm(message)
	if (arethey) {location.href=url}
}


var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Va rog sa cititi/acceptati termeni si conditile pentru a putea trimete anuntul")
return false
}
}
}



/***********************************************
* Amazon style Drop-in content box- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
* Go to http://www.dynamicdrive.com/ for full source code
***********************************************/

var dropboxleft=200 //set left position of box (in px)
var dropboxtop=100 //set top position of box (in px)
var dropspeed=15 //set speed of drop animation (larger=faster)

//Specify display mode. 3 possible values are:
//1) "always"- This makes the fade-in box load each time the page is displayed
//2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session
//3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer...
// For example, 2 would display the box about (1/2) 50% of the time the page loads.

var displaymode="4"

///Don't edit beyond here///////////

if (parseInt(displaymode)!=NaN)
var random_num=Math.floor(Math.random()*displaymode)
var ie=document.all
var dom=document.getElementById

function initboxv2(){
if (!dom&&!ie)
return
crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover
crossbox=(dom)?document.getElementById("dropinboxv2"): document.all.dropinboxv2
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossbox.height=crossbox.offsetHeight
crossboxcover.style.height=parseInt(crossbox.height)+"px"
crossbox.style.top=crossbox.height*(-1)+"px"
crossboxcover.style.left=dropboxleft+"px"
crossboxcover.style.top=dropboxtop+"px"
crossboxcover.style.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropinv2()",50)
}

function dropinv2(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossbox.style.top)<0){
crossboxcover.style.top=scroll_top+dropboxtop+"px"
crossbox.style.top=parseInt(crossbox.style.top)+dropspeed+"px"
}
else{
clearInterval(dropstart)
crossbox.style.top=0
}
}

function dismissboxv2(){
if (window.dropstart) clearInterval(dropstart)
crossboxcover.style.visibility="hidden"
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

if (displaymode=="oncepersession" && get_cookie("droppedinv2")=="" || displaymode=="always" || parseInt(displaymode)!=NaN && random_num==0){
if (window.addEventListener)
window.addEventListener("load", initboxv2, false)
else if (window.attachEvent)
window.attachEvent("onload", initboxv2)
else if (document.getElementById || document.all)
window.onload=initboxv2
if (displaymode=="oncepersession")
document.cookie="droppedinv2=yes"
}



var rector=6

///////DONE EDITTING///////////
var stopit=0 
var a=1

function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}

function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}

function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}


 function deschide(cale)
      {
      eval("window.open('"+cale+"','a2',' toolbar=no, menubar=no,scrollbars=yes,resizable=no,height=480,width=680,top=10,left=10')");
      }