//var url_download='http://www.playunited.com/SmartDownload.php';

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//pt popup de download pe priam pagina

var dragswitch=0
var nsx
var nsy
var nstemp


function down(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function move(e){
	if (dragswitch==1){
	temp.moveBy(e.x-nsx,e.y-nsy)
	return false
	}
}

function up(){
temp.releaseEvents(Event.MOUSEMOVE)
}


function drag_drop(e){
	if (ie4&&dragapproved){
	    crossobj.style.left=tempx+event.clientX-offsetx
	    crossobj.style.top=tempy+event.clientY-offsety
	    return false
	}
	else if (ns6&&dragapproved){
	    crossobj.style.left=tempx+e.clientX-offsetx+"px"
	    crossobj.style.top=tempy+e.clientY-offsety+"px"
	    return false
	}
}








function initialize_drag(e,pop,dragbar){
pop = (pop) ? pop : "pop";
dragbar = (dragbar) ? dragbar : "dragbar";
crossobj=ns6? document.getElementById(pop) : eval("document.all."+pop)
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!=dragbar){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id==dragbar){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=function(e){
	drag_drop(e);
	//overhere(e);
}
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hide_box(pop){
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
eval("document."+pop+".visibility=\"hide\"")
}

function Download(){
    parent.top.location.href=download_link;
}


function on_load(){
		setTimeout('openalertpop();',2500);
}

function openalertpop(){
	if (ie4) {
		document.all.alertpop.style.visibility="visible";
		document.all.alertpop.style.width = 375;
	}
	else if (ns6) {
		document.getElementById("alertpop").style.visibility="visible";
	}
}


//end pop up donwload










// make the Exit Popup

var exit_popup=true; // pentru exit popup
var function_onload_called=false;
var function_onunload_called=false;

function popup(file) {
		var leftPos = (screen.availWidth-600) / 2
		var topPos = (screen.availHeight-500) / 2
 		showHelpWin = window.open(file,'','width=616,height=500,scrollbars=yes,resizable=yes,titlebar=0,top=' + topPos + ',left=' + leftPos);
}


function on_unload(){
	if(exit_popup && exit_page!='' && !function_onunload_called){
		popup(exit_page);
	}
	function_onunload_called=true;
}
//exit popup




function startclock()
      {
        var thetime=new Date();
        var nhours=thetime.getHours();
        var nmins=thetime.getMinutes();
        var nsecn=thetime.getSeconds();
        if (nhours>=13)
        nhours-=12;
        if (nhours==0)
         nhours=12;
        if (nsecn<10)
         nsecn="0"+nsecn;
        if (nmins<10)
         nmins="0"+nmins;
        document.clockform.clockspot.value=nhours+":"+nmins+":"+nsecn;
        setTimeout('startclock()',1000);
      }


function mm_swapImgRestore() { //v3.0
      var i,x,a=document.mm_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
      }

      function mm_preloadimages() { //v3.0
      var d=document; if(d.images){ if(!d.mm_p) d.mm_p=new Array();
      var i,j=d.mm_p.length,a=mm_preloadimages.arguments; for(i=0; i<a.length; i++)
      if (a[i].indexOf("#")!=0){ d.mm_p[j]=new Image; d.mm_p[j++].src=a[i];}}
      }

      function mm_findObj(n, d) { //v4.0
      var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
      d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=mm_findObj(n,d.layers[i].document);
      if(!x && document.getElementById) x=document.getElementById(n); return x;
      }

      function mm_swapimage() { //v3.0
      var i,j=0,x,a=mm_swapimage.arguments; document.mm_sr=new Array; for(i=0;i<(a.length-2);i+=3)
      if ((x=mm_findObj(a[i]))!=null){document.mm_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }




