function ChangeButton(imgName){
  var currImg = document.getElementById(imgName);
  currImg.src="images/"+imgName+"_over.jpg";
}

function ChangeButtonBack(imgName)
{
  var currImg = document.getElementById(imgName);
  currImg.src="images/"+imgName+".jpg";
}

function chk_search_field(fld_id){
	var search_field= document.getElementById('msviLSBtbox');
	if (search_field.value=='microsoft.com/austria durchsuchen'){
		search_field.value='';	
	}else if (search_field.value==''){
		search_field.value='microsoft.com/austria durchsuchen';
	}
}

function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curleft += obj.offsetLeft;obj = obj.offsetParent;};}
	else if (obj.x){
		curleft += obj.x;
	}
 	return curleft;
 }
function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			curtop += obj.offsetTop;obj = obj.offsetParent;};}
	else if (obj.y){
		curtop += obj.y;
	}
 	return curtop;
}

function place_infobox(self, text){
	var infobox=document.getElementById('popup_box');
	var infobox_width=infobox.offsetWidth;
	infobox.style.visibility='visible';
	infobox.style.left=findPosX(self)-infobox_width+25+'px';
	infobox.style.top=findPosY(self)+'px';
	var infobox_content=document.getElementById('popup_content');
	infobox_content.innerHTML=text;
}

function change_value(select_id,input_id){
	document.getElementById(input_id).value = document.getElementById(select_id).options[document.getElementById(select_id).options.selectedIndex].value;
}

function add_more() {
	var txt = "<br><table border=\"0\" width=\"100%\"><tr><td><input type=\"file\" name=\"sonst_uploads[]\"></td></tr></table>";
	var dv_uploads = document.createElement("DIV");
	 /*  var tr=tbl.insertRow(tbl.rows.length);
		var td=tr.insertCell(tr.cells.length);
			td.innerHTML="<div id=\"dv_multiple_upload\"><input type=\"file\" name=\"sonst_uploads[]\" class=\"more_uploads\" /></div>";
		tbl.appendChild(tr); */
	dv_uploads.innerHTML="<input type=\"file\" name=\"sonst_uploads[]\" class=\"more_uploads\" />";
	
  document.getElementById("dv_spec_input").appendChild(dv_uploads);// += txt;
}

var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
function fixPNG(myImage){
	
	for(var i=0; i<document.images.length; i++){
		var img = document.images[i]
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
			var imgID = (img.id) ? "id='" + img.id + "' " : ""
			var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			var imgStyle = "display:inline-block;" + img.style.cssText 
			if (img.align == "left") imgStyle = "float:left;" + imgStyle
			if (img.align == "right") imgStyle = "float:right;" + imgStyle
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
			var strNewHTML = "<span " + imgID + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}


if(typeof(DD)=="undefined"){
	var DD = new Object();
}
	DD.validation = new Object();
	DD.validation.clearValue=function(callObj,defVal,act){
		if(act && callObj.value==defVal){
			callObj.value="";
		}else if(!act && !callObj.value){
			callObj.value=defVal;
		}
	}
DD.validation.validateLiveSearchForm = function(callObj){
	if( (callObj.qu.value=='microsoft.com/austria durchsuchen') || (!callObj.qu.value)){
		alert("Bitte geben Sie einen Suchbegriff ein!");
		return false;
	}

}