function FocusBlank() {
	if(document.cautare.keyword.value=='search')document.cautare.keyword.value='';
}

function BlurAdd() {
	if(document.cautare.keyword.value=='')document.cautare.keyword.value='search';
}

function checkcontact() {

	if (document.formular.nume.value.length <= 2){
		alert('Introduceti numele dvs.!'); 
		document.formular.nume.focus(); 
		return false;
	}

	if (document.formular.email.value == "" || (document.formular.email.value.indexOf("@",0) == -1||document.formular.email.value.indexOf(".",0) == -1)) { 
		alert('Introduceti adresa dvs. de e-mail!');
		document.formular.email.focus(); 
		return false;
	}

	if (document.formular.mesaj.value.length <= 5){
		alert('Scrieti un mesaj!'); 
		document.formular.mesaj.focus(); 
		return false;
	}

	return true;
}



function sfHover() {
	var sfEls = document.getElementById("mainmenu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className += " sfHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.substring(0, this.className.indexOf(' '));
		}
	}
}
function activeTabs() {
	var tabs=document.getElementById("mainmenu").getElementsByTagName("UL");
	for (var j=0; j<tabs.length; j++) {
			tabs[j].onmouseover=function() {
				this.parentNode.firstChild.className += ' activeTab';
			}
			tabs[j].onmouseout=function() {
				this.parentNode.firstChild.className=this.parentNode.firstChild.className.replace(new RegExp(" activeTab\\b"), "");
			}
	}
}

function showActive(elem) {
	elem.parentNode.parentNode.parentNode.firstChild.className += ' onState';
}
function hideActive(elem) {
	elem.parentNode.parentNode.parentNode.firstChild.className = elem.parentNode.parentNode.parentNode.firstChild.className.replace(new RegExp(" onState\\b"), "");
}

var gdCookiePath = "/";
var gdCookieDomain = ".weisspunkt.ro";

var gdClockSkew = 0;

var gdDEBUGerrorCounter = 0;
gdDEBUGerrorArray = new Array();

function gdInit(){
	gdIsLoaded = true;
	gdCreateRollOvers();
        CheckSearchTerms();
	return gdStart();
}

function gdStart(){
	gdDoRun = true;
	//gdSetFlash();
	gdHideFlash("visible");
	return true;
}

function gdStop(){
	gdDoRun = false;
	gdHideFlash("hidden");
	return true;
}

function gdDestroy(){
	gdStop();
	return true;
}

function gdError(errorMessage, errorURL, errorLineNumber){
	//Assert.isFalse(errorMessage, gdDEBUG, errorLineNumber + ':' + errorURL)
	gdDEBUGerrorArray[gdDEBUGerrorCounter++] = errorLineNumber + ":" + errorMessage + "[" + errorURL + "]";
    return true;
}

function gdCreateRollOvers(){
	if(document.getElementById){
		var gdImages = document.getElementsByTagName('IMG');
		var gdButtons = document.getElementsByTagName('INPUT');
	}else if(document.all){
		var gdImages = document.all['mouseovers'].all.tags('IMG');
		var gdButtons = document.all['mouseovers'].all.tags('INPUT');
	}else return;
	gdPreloads = new Object();

	for (var i = 0; i < gdImages.length; i++){
		var gdImageOffSrc = gdImages[i].src + "";
		if(gdImageOffSrc.indexOf("_xoff") != -1){
			var gdImageOnSrc = gdImageOffSrc.replace(/_xoff/g, "_xon");
			gdPreloads['gdImageOff_' + i] = new Image();
			gdPreloads['gdImageOff_' + i].src = gdImageOffSrc;
			gdPreloads['gdImageOn_' + i] = new Image();
			gdPreloads['gdImageOn_' + i].src = gdImageOnSrc;
			gdPreloads['gdImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}
			gdImages[i].onmouseover = function(){this.src = this.src.replace(/_xoff/g, "_xon");}
			gdImages[i].onmouseout = function(){this.src = this.src.replace(/_xon/g, "_xoff");}
		}
	} 

	for (var i = 0; i < gdButtons.length; i++){
		if(gdButtons[i].src){
		var gdImageOffSrc = gdButtons[i].src + "";
		if(gdImageOffSrc.indexOf("_xoff") != -1){
			var gdImageOnSrc = gdImageOffSrc.replace(/_xoff/g, "_xon");
			gdPreloads['gdImageOff_' + i] = new Image();
			gdPreloads['gdImageOff_' + i].src = gdImageOffSrc;
			gdPreloads['gdImageOn_' + i] = new Image();
			gdPreloads['gdImageOn_' + i].src = gdImageOnSrc;
			gdPreloads['gdImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}
			gdButtons[i].onmouseover = function(){this.src = this.src.replace(/_xoff/g, "_xon");}
			gdButtons[i].onmouseout = function(){this.src = this.src.replace(/_xon/g, "_xoff");}
		}
		}
	} 
}

hideFlashTimer = setTimeout("void(null)", 1);
xstat = "";
function gdHideFlash(status){
//xstat += status;
//window.status = xstat;
	clearTimeout(hideFlashTimer);
	if(status == "hidden"){
		gdHideFlash2(status);
	}else{
		clearTimeout(hideFlashTimer);
		hideFlashTimer = setTimeout("gdHideFlash2('"+status+"')", 3000);
//		hideFlashTimer = setTimeout("gdHideFlash2('visible')", 3000);
		//gdHideFlash2(status);

	}
}

function debugMessage(message){
	gdMainFlashContainer = xbGetElementById("gdFlashTest");
	if(gdMainFlashContainer == null) return;
	gdMainFlashStyle = new xbStyle(gdMainFlashContainer);
	if(gdMainFlashStyle == null) return;
	gdMainFlashStyle.setInnerHTML(message);
}

function gdHideFlash2(status){
	//debugMessage("flash: " + status);
	//window.status = "flash: " + status;
	gdHidePromotionFlash(status);

	if(navigator.org == "microsoft") return;
	gdMainFlashContainer = xbGetElementById("gdMainFlash");
    if(gdMainFlashContainer == null) return;
	gdMainFlashStyle = new xbStyle(gdMainFlashContainer);
	if(gdMainFlashStyle == null) return;
	if((status == "visible")&&(gdFlashVersion >= gdFlashRequiredVersion)){
		if((navigator.family == "nn4")||(navigator.family == "opera")||(navigator.org == "microsoft")){
			gdMainFlashStyle.setVisibility("visible");
		}else{
			gdMainFlashStyle.setLeft(16);
		}
	}else{
		if((navigator.family == "nn4")||(navigator.family == "opera")||(navigator.org == "microsoft")){
			gdMainFlashStyle.setVisibility("hidden");
		}else{
		    gdMainFlashStyle.setLeft(-1000);
		}
	}
}

function gdHidePromotionFlash(status){
	if(navigator.org == "microsoft") return;
    gdMainFlashContainer = xbGetElementById("gdFlashTest");
    if(gdMainFlashContainer == null) return;
	gdMainFlashStyle = new xbStyle(gdMainFlashContainer);
	if(gdMainFlashStyle == null) return;
	if(status == "visible"){
		if((navigator.family == "nn4")||(navigator.family == "opera")){
			gdMainFlashStyle.setVisibility("visible");
		}else{
			gdMainFlashStyle.setInnerHTML(gdFlashPromotion);
		}
	}else{
		if((navigator.family == "nn4")||(navigator.family == "opera")){
			gdMainFlashStyle.setVisibility("hidden");
		}else{
			gdMainFlashStyle.setInnerHTML(gdFlashPromotionAlt);
		}
	}
}

function gdDetectClockSkew(){
	var epoch = new Date(0);
	gdClockSkew = epoch.getTime();
}
gdDetectClockSkew();
//Assert.isFalse((gdClockSkew > 0), gdDEBUG, "Clock skew detected: " + gdClockSkew);

function gdFixClockSkew(date) {
	if(gdClockSkew > 0) date.setTime(date.getTime() - gdClockSkew);
	return date;
}

function gdSetCookie(name, value, expires, path, domain, secure){
	var gdCookie = name + "=" + escape(value)
		+ ( (expires) ? "; expires=" + gdFixClockSkew(expires).toGMTString() : "" )
		+ "; path=" + ( (path) ? path : gdCookiePath )
		+ "; domain=" + ( (domain) ? domain : gdCookieDomain )
		+ ( (secure) ? "; secure" : "");
	document.cookie = gdCookie;
}

function gdGetCookie(name){
	var gdCookie = document.cookie;
	var prefix = name + "=";
	var begin = gdCookie.indexOf("; " + prefix);
	if (begin == -1) {
		begin = gdCookie.indexOf(prefix);
		if (begin != 0) return null;
	}else{
		begin += 2;
	}
	var end = gdCookie.indexOf(";", begin);
	if (end == -1) end = gdCookie.length;
	return unescape(gdCookie.substring(begin + prefix.length, end));
}

function gdEraseCookie(name, path, domain) {
	if (gdGetCookie(name)){
		var gdCookie = name + "="
			+ "; path=" + ( (path) ? path : gdCookiePath )
			+ "; domain=" + ( (domain) ? domain : gdCookieDomain )
			+ "; expires=Thu, 01-Jan-70 00:00:01 GMT";
		document.cookie = gdCookie;
	}
}

////

function gdSetFlash(){
	gdMainFlashContainer = xbGetElementById("gdMainFlash");
	if(gdMainFlashContainer == null) return;
	gdMainFlashStyle = new xbStyle(gdMainFlashContainer);
	if(gdMainFlashStyle == null) return;
	gdMainFlashStyle.setInnerHTML('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="545" height="175">'
			+'<param name="movie" value="/flash/'+site+'/'+flash+'/index.swf?language='+locale+'" />'
			+'<param name="quality" value="high" />'
			+'<param name="wmode" value="transparent" />'
			+'<embed wmode="transparent" src="/flash/'+site+'/'+flash+'/index.swf?language='+locale+'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="545" height="175"></embed>'
			+'</object>');
			
}

// this function needs to be called, preferably during the onload event
function CheckSearchTerms()
{
}