<!--		
/*
Mozilla 1.7:
	userAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1;en-US; rv:1.7) Gecko/20040616
	appVersion: 5.0 (Windows;en-US)
	appName: Netscape
IE 6.0:
	userAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
	appVersion: 4.0 (compatible; MSIE 6.0; Windows NT 5.1;  .NET CLR 1.1.4322
	appName: Microsoft Internet Explorer
Firefox 0.9.1:
	userAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
	appVersion:5.0 (Windows;en-US)
	appName: Netscape
Netscape 7.1:
	userAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
	appVersion: 5.0 (Windows;en-US)
	appName: Netscape
Netscape 7.0:
	userAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02
	appVersion: 5.0 (Windows;en-US)
	appName: Netscape
Opera 7.51:
	userAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.51 [en]
	appVersion: 4.0 (compatible; MSIE 6.0; Windows NT 5.1
	appName: Microsoft Internet Explorer
*/
function Browser()
{
 	this.Opera = 0;
	this.ie6 = 0;
	this.Mozilla = 0;
	this.nn7 = 0;
	this.nn6 = 0;
	this.Firefox = 0;
 	this.AppVersion = navigator.appVersion;
	this.AppName = navigator.appName;
	this.Dom = document.getElementById?1:0;
	this.UserAgent = navigator.userAgent;
	if(nPos = this.UserAgent.indexOf("Opera") != -1)
	{
	 	this.Opera = 1;
		this.Version = parseInt(this.UserAgent.substring(nPos + 6));
	}
	else if(nPos = this.UserAgent.indexOf("MSIE 6.0") != -1)
	{
	 	this.ie6 = 1;
		this.Version = 6;
	}
	else if(nPos = this.UserAgent.indexOf("MSIE 5.0") != -1)
	{
	 	this.ie5 = 1;
		this.Version = 5;
	}
	else if(nPos = this.UserAgent.indexOf("Netscape/7") != -1)
	{
	 	this.nn7 = 1;
		this.Version = 7;
	}
	else if(nPos = this.UserAgent.indexOf("Netscape6") != -1)
	{
	 	this.nn6 = 1;
		this.Version = 6;
	}
	else if(nPos = this.UserAgent.indexOf("Firefox") != -1)
	{
	 	this.Firefox = 1;
		if(this.UserAgent.substring(nPos + 9,1) == '0')
			this.Version = parseInt(this.UserAgent.substring(nPos + 11));
		else
			this.Version = parseInt(this.UserAgent.substring(nPos + 9));
	}
	else if(nPos = this.UserAgent.indexOf("Gecko") != -1)
	{
	 	this.Mozilla = 1;
		this.Version = parseInt(this.appVersion);
	}
/*	else
		alert(this.UserAgent + " - " + this.appName + " " + this.appVersion);
	alert( 	" Opera:"+this.Opera+
			" ie6:"+this.ie6+
			" Mozilla:"+this.Mozilla+
			" nn7:"+this.nn7+
			" nn6:"+this.nn6+
			" Firefox:" + this.Firefox+
			" Dom:" + this.Dom+
			" UserAgent:"+this.UserAgent);*/
}

oBrows = new Browser();

function CheckBrowser()
{
 	if(oBrows)
	{
		if(oBrows.ie6)
			return "ie6";
		if(oBrows.Mozilla)
			return "mozilla";
		if(oBrows.nn7)
			return "nn7";
		if(oBrows.nn6)
			return "nn6";
		if(oBrows.Opera)
			return "Opera";
		if(oBrows.Firefox)
			return "Firefox";
	}
	if(document.all)
		return "ie4";
	if(document.layers)
		return "nn4";
	return "?";
}
function GetObj(sName)
{
 	if(oBrows && oBrows.Dom)
		 return document.getElementById(sName);
		
	sBrows = CheckBrowser();
 	switch(sBrows)
	{
		case "ie4":
			 return document.all[sName];
			 break;
		case "nn4":
			 return document.layers[sName];
		default:
			return null;
	}
}

function ChangeLang(lNumLang)
{
 	oObj = GetObj('Lang');
	oObj.value = lNumLang;
	document.forms[0].submit();					 
	return false;
}	  

function AdaptPhoto(oObj)
{			 
	if(oObj.width > 400)
	{
		fRatio = oObj.width / 400;
		oObj.width = oObj.width / fRatio;
	}													   
	
}

function ChangePhoto(oObj)
{				
	oPrinc = GetObj('photo');  
	sSrc = oPrinc.src;
	oPrinc.src = oObj.src;
	oObj.src = sSrc;
	Init();
	AdaptPhoto(oPrinc);
}

function OpenMiniWindow(sUrl)
{      
	eval('open("'+sUrl+'","","location=no,menubar=no,resizable=no,scrollbars=no,status=yes,toolbar=no,width=500,height=200")');
}

function DelAd(bPerm)
{                                                      
	oForm = GetObj('formad');
    if(oForm == null) oForm = document.forms["formad"];
	oForm.action = "addelete.php" + (bPerm ? "?Perm" : "");					 
    oForm.submit();
}

function ChangeSrc(sPhotoId, sPath)
{            
	oPhoto = GetObj(sPhotoId);
    if(oPhoto == null) return;
    oPhoto.src = sPath;
    sMsg = oPhoto.id + '=' + oPhoto.src;
    alert(sMsg);
}

function ShowAd()
{                                                      
	oForm = GetObj('formadr');
    if(oForm == null) oForm = document.forms["formadr"];
	oForm.action = "admanage.php";					 
    oForm.submit();
}

function DelAdr(bPerm)
{                                                      
	oForm = GetObj('formadr');
    if(oForm == null) oForm = document.forms["formadr"];
	oForm.action = "adrdelete.php" + (bPerm ? "?Perm" : "");					 
    oForm.submit();
}       
function DelCat()
{                                                      
	oForm = GetObj('formcat');
    if(oForm == null) oForm = document.forms["formcat"];
	oForm.action = "catdelete.php";					 
    oForm.submit();
}

function CancelAdvert(sSession)
{
	oForm = GetObj('formad');
    if(oForm == null) oForm = document.forms["formad"];
	oForm.action = "advalid.php?session_id='" + sSession  + "'";					 
    oForm.submit();
}

function AddPhoto()
{
	oForm = GetObj('formad');
    if(oForm == null) oForm = document.forms["formad"];
	oForm.action = "addphoto.php";					 
    oForm.submit();
}                   

function StartPayment()
{
	oForm = GetObj('formphoto');
    if(oForm == null) oForm = document.forms["formphoto"];
	oForm.action = "paymentPP.php";					 
    oForm.submit();
}                   

function StartPaymentPP()
{
	oForm = GetObj('formphoto');
    if(oForm == null) oForm = document.forms["formphoto"];
	oForm.action = "paymentPP.php";					 
    oForm.submit();
}                   

function LoadPhoto()
{
	oForm = GetObj('formphoto');
    if(oForm == null) oForm = document.forms["formphoto"];
	oForm.action = "addphoto.php";					 
    oForm.submit();
}

function UnloadPhoto(Id)
{
	oForm = GetObj('formphoto');
    if(oForm == null) oForm = document.forms["formphoto"];  
	oForm.action = "addphoto.php?d="+Id;					 
    oForm.submit();
}


function Init()
{		
	// Initialize category menu size
 	oMenu = GetObj("menucategorie");
 	oInMenu = GetObj("inmenu");		
	if(oMenu && oInMenu)
		oMenu.style.height = oInMenu.offsetHeight + 20;

	// Initialize left column size
 	oLeftCol = GetObj("leftcol");
 	oPage = GetObj("page");				  		 
	
	if(800 <= oLeftCol.offsetHeight + 400)						 
	{
		oLeftCol.style.height = oLeftCol.offsetHeight + 400; // + (CheckBrowser() != "ie6" ? 50 : 0);
	}
	else if(800 <= oPage.offsetHeight)
	{
		oLeftCol.style.height = oPage.offsetHeight;
	}
}		

function OpenMail(nId, nAdId, sLang)
{
	eval('open("contacts.php?Dest='+nId+'&Ad='+nAdId+'&Lang='+sLang+'","","location=no,menubar=no,resizable=no,scrollbars=auto,status=yes,toolbar=yes,width=600,height=600")');
	return false;
}
  

function TransCat()
{                                                      
	oForm = GetObj('formcat');
    if(oForm == null) oForm = document.forms["formcat"];
	oForm.action = "cattrans.php";					 
    oForm.submit();
}

function ChangePrice(oLang)
{	   	 
	lPrice = 0;
	for(lIndex = 1; lIndex < 5; lIndex ++)
	{										 
		sName = 'duration'+lIndex;
		oDuration = GetObj(sName);
		if(oDuration.checked)		  
		{				   
			lDuration = Number(oDuration.value)
			lPrice += lDuration;
		}
	}
	oCurrency = GetObj('currency1');
	if(!oCurrency.checked)
		lPrice += 0.5;
	oPrice = GetObj('price');
	oPrice.value =  FormatPrice(lPrice, oLang);			
}

function FormatPrice(lPrice, oLang)				 
{			 					
	var lNewPrice;
	var lRem;
	var oNewPrice;
	var lLong;
	var oUpper;				 
	lNewPrice = Math.floor(lPrice); 
	lRem = lPrice - lNewPrice;
	oNewPrice = '' + lNewPrice;
	if (lNewPrice > 999) 
	{				 
		lLong = oNewPrice.length;
		oUpper = oNewPrice.substr(0,lLong-3);
		oUpper = FormatPrice(oUpper, oLang);
		if(oLang == 'en')						
		{
			oNewPrice = '' + oUpper + ' ' + oNewPrice.substr(lLong-3,3);
		}
		else									  
		{
			oNewPrice = '' + oUpper + '.' + oNewPrice.substr(lLong-3,3);
		}
	}											
	if(lRem)								  
	{																  
		lRem = Math.ceil(lRem*100);
		if(oLang == 'en')
			oNewPrice = oNewPrice + '.' + lRem;
		else
			oNewPrice = oNewPrice + ',' + lRem;
	}
	return oNewPrice;
}
-->