function openClientWindow(clientInt,clientID,submitedform,currentPage) {
  document.location.href= "/clients/FRAMESET_clients.asp?submitedform="+ submitedform +"&currentPage="+ currentPage +"&clientInt="+ clientInt +"&ID="+clientID+"&SQLBehind="+ExecutedSQL
}

function moveArtworksWindow(artworkCode,artist) {
  parent.mainFrame.location.href= "/artworks/moveArtworks.asp?artworkcode="+artworkCode+"&artist="+artist
}

function openNewClientWindow() {
  parent.mainFrame.location.href= "/clients/FRAMESET_clients.asp"
}
function openNewArtworkWindow() {
  parent.mainFrame.location.href= "/artworks/FRAMESET_artworks.asp"
}

function openArtworkWindow(artworkInt,artworkID,currentPage) {
  document.location.href= "/artworks/FRAMESET_artworks.asp?currentPage="+ currentPage +"&artworkInt="+ artworkInt +"&ID="+artworkID+"&SQLBehind="+ExecutedSQL
}
function openSoldArtworkWindow(artworkInt,artworkID,currentPage) {
//  window.open("/soldartworks/soldArtworkForm.asp?artworkInt="+ artworkInt +"&ID="+artworkID+"&SQLBehind=","artworkWindow","location=no,status=no,toolbar=no,menubar=no,scrollbars=yes,width=880,height=420,left=20,top=20,resizable");
  document.location.href= "/soldartworks/FRAMESET_soldArtworks.asp?currentPage="+ currentPage +"&artworkInt="+ artworkInt +"&ID="+artworkID+"&SQLBehind="+ExecutedSQL
}

function downloadFile(FileName) {
  window.open(FileName,"openFileWindow","location=no,status=no,toolbar=no,menubar=no,scrollbars=yes,width=880,height=600,left=20,top=20,resizable");
}

var selectedMenu = false
function doMenu(menuObj){
	if(selectedMenu != false){
		selectedMenu.className = "menu"
	}
	if(menuObj){
		menuObj.className = "menuselected"
		selectedMenu = menuObj
	}
}
onclick="doLangString(this)"

var selectedLangString = false
var shownLangFormField = false
function doLangStringMenu(langObj, langFormField){
	if(selectedLangString != false){
		selectedLangString.className = "menu"
	}
	
	if(langObj){
		langObj.className = "menuselected"
		selectedLangString = langObj
	}

	langFormField.style.display = "block";
	if(shownLangFormField){
		shownLangFormField.style.display = "none";
	}
	shownLangFormField = langFormField;

}

var selectedRow = false
function selectRow(objName){

	rowObj = document.getElementsByName(objName)

	if(selectedRow != false){
		rowObjOld = document.getElementsByName(selectedRow)
		for(r=0;r<rowObjOld.length;r++){
			rowObjOld[r].className = "listTableBody"
		}
	}
	
	for(r=0;r<rowObj.length;r++){
		rowObj[r].className = "listTableBodySelected"
	}
	
	selectedRow = objName
}

function visBillede(id, x , y, elementet, sti){
	//viser billede
	//finder tabellen, sætter det skjulte elements top til tabellens afstand til top.
	var linken = elementet.parentElement;
	var cellen = linken.parentElement;
	var raekken = cellen.parentElement;
	var tbodyen = raekken.parentElement;
	var tabellen = tbodyen.parentElement;
	 //document.all.billedekasse.innerHTML= "<img src=http://www.lauritz.com/images/varer/g/g" + id + "-1.jpg class=gulboks>"
	 document.all.billedekasse.innerHTML= "<img src=" + sti + " class=gulboks>"
	 document.all.billedekasse.style.left= x;
	 document.all.billedekasse.style.top= tabellen.offsetTop;
	 document.all.billedekasse.style.visibility="visible";
}

function showImage(tnPath){
	if(tnPath!=''){
		document.getElementById("billedekasse").innerHTML= "<img src=" + tnPath + " width='100' border=0>"
		document.getElementById("billedekasse").style.top = window.event.y+document.body.scrollTop
		document.getElementById("billedekasse").style.visibility="visible";
	}
}

function hideIamge(){
	document.getElementById("billedekasse").style.visibility="hidden";
}

function isDate(str){
	var myPat = /\d\d-\d\d-\d\d\d\d/;
	if(myPat.test(str)  != true){
		return false
	}
	else return true
}

function placeCity(val,obj){
	if(eval("citys['"+val+"']")){
		obj.value = eval("citys['"+val+"']")
	}
}
function clearFrame(FrameToClear,ShowString){
	window.parent.frames[FrameToClear].document.body.innerHTML = "<p class='normal'><b>" + ShowString +"</b></p>";
}

