var imgPromotie;

function Go(){return}

function onLoadPage(){
	var path = document.getElementById('imaginePromotie').src;
	while (path.indexOf("/") != -1)
		path = path.slice(path.indexOf("/") + 1);
	imgPromotie = path;
	}

function news(id){
	document.getElementById(id+'_descr').innerHTML = document.getElementById(id+'_descrlong').innerHTML;
}

function read(html){
    document.getElementById('content').innerHTML=html;
	document.getElementById('subs').innerHTML = '<img src="img/1px.gif" border="0" height="1" width="148">';
}

function dealers(html){
    document.getElementById('dealeri').innerHTML=html;
}

function formType(id){
	var html = document.getElementById('formular'+id).innerHTML;
	document.getElementById('formular').innerHTML = html;
	}

function prod(html){
    if (html !== 'donothing') {
		var arr = html.split('@@@');
		document.getElementById('content').innerHTML=arr[0];
		document.getElementById('subs').innerHTML=arr[1];
	}
	//alert(html);
}

function puttext(id){
	document.getElementById('textad').innerHTML = document.getElementById(id).innerHTML;
	
	}

function prodimg(id){
	var sm = id.src;
	while (sm.indexOf("/") != -1)
		sm = sm.slice(sm.indexOf("/") + 1);
	document.getElementById('img1').src = 'img/produse/small/'+sm;
}

function categimg(id){
	var sm = id.src;
	while (sm.indexOf("/") != -1)
		sm = sm.slice(sm.indexOf("/") + 1);
	document.getElementById('img1').src = 'img/categ/small/'+sm;
}

function getpath(id,folder){
	var path = id.src;
	while (path.indexOf("/") != -1)
		path = path.slice(path.indexOf("/") + 1);	
	
	if (path !== '1px.gif') x_imgsize(path,folder,openWindow);
	}

function imgSwap(oImg)
{
   var strOver  = "_on"    
   var strOff = "_off"    
   var strImg = oImg.src
   if (strImg.indexOf(strOver) != -1) 
      oImg.src = strImg.replace(strOver,strOff)
   else
      oImg.src = strImg.replace(strOff,strOver)
}

function flashDetect(){
	hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	
	if (hasReqestedVersion) { x_dealeri(read);} 
	else {x_noflash(read); }
}

function openWindow(res){
	var arr = res.split('@@@');
	var path = arr[0];
	var w = arr[1];
	var h = arr[2];
	
	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = parent.window.innerWidth;
	  winH = parent.window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = parent.document.body.offsetWidth;
	  winH = parent.document.body.offsetHeight;
	 }
	}	
	
	x=winW/2-w/2;
	y=winH/2-h/2;	
	window.open(path,'image','width='+w+', height='+h+', toolbar=0, location=0, resizable=0, menubar=0, status=0, titlebar=0, left='+x+', top='+y);
}
