/*
 * By Rui Filipe Da Cunha Alves
 * 02-12-2007
 */

function getElement(objID){
	if (document.getElementById) {return document.getElementById(objID);}
  else if (document.all) {return document.all[objID];}
  else if (document.layers) {return document.layers[objID];}
}
function htmlspecialchars(ch) {
   ch = ch.replace(/&/g,"&amp;")
   ch = ch.replace(/\"/g,"&quot;")
   ch = ch.replace(/\'/g,"&#039;")
   ch = ch.replace(/</g,"&lt;")
   ch = ch.replace(/>/g,"&gt;")
   return ch
}
function htmlsp(ch) {
   ch = ch.replace(/\"/g,"&quot;")
   ch = ch.replace(/\'/g,"&#039;")
   return ch
}

function trim(aString) {
    return aString.replace(/^\s+/, "").replace(/\s+$/, "");
}
function checkEmail(email_adress) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(email_adress)){
			return (true);
	}
	return (false);
}

function hide_dthml(){
	var el = getElement('dhtmlw');
	el.style.visibility="hidden";
	el.innerHTML = "";
}
function show_dhtml(){
	var cont = getElement('dhtmlw')
	cont.style.visibility="visible";
	var code ='';
//	code +='<div class="spacebefore"></div>';
	code +='<iframe src="http://www.autoscout24.ch/as24web/customlist.aspx?cuid=64634&lng=fra&member=64634" width="800" height="408" scrolling="auto" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" style="background-color: #000000" ALLOWTRANSPARENCY="true"></iframe>';
	cont.innerHTML = code;
}

/* WORKAROUND POUR IE !!! (forcer le repositionnement lors du redimensionnement de la fenêtre)*/
function ifresizeon_ie(){
	var cont = getElement('dhtmlw');
	if(cont.style.visibility=="visible"){
		cont.style.visibility="hidden";
		cont.style.visibility="visible";
		//alert("size");
	}
}
