function showMenu(id) {
	document.location.href = 'productmain.asp?tekstID='+(id+10)
}

function toonProduct(naam) {
	if (naam!="" && naam!=undefined) {
		document.all["main1"].innerHTML = "<h1>" + naam + "</h1><P>Toon productinfo hier..."
	}
}

function mask(object) {
	strStyle='none'
	
	if (object.style.filter==strStyle) object.style.filter='gray'
	else object.style.filter = strStyle
}

function insertFlash(file,width,height) {
	document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"' id=hydrospex>");
	document.write("<param name='movie' value='swf/"+file+"' />");
	document.write("<param name='quality' value='high' />");
	document.write("<param name='wmode' value='transparent' />");
	document.write("<param name='bgcolor' value='#000000' />");
	document.write("<param name='menu' value='false' />");
	document.write("<embed src='swf/"+ file +"' quality=high bgcolor=#000000 width='"+width+"' height='"+height+"' name=hydrospex wmode=transparent allowScriptAccess=always type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer />");
	document.write("</object>");
}

pageHTML = ""
function cmdExec(cmd,opt) {
	if(pageHTML != undefined && pageHTML!="") {
		pageHTML.document.execCommand(cmd,"",opt);
		pageHTML.focus();
	}
}

function changeHeader(strTag) {
	var rngSelection;
	oFocus = event.srcElement;
	alert(oFocus)
	rngSelection = oFocus.DOM.selection.createRange();
}

function createLink() {
	cmdExec("CreateLink");
}


function insertDownloads(prodID)
{  
	returnVal = window.open( "downloads.asp?prodID="+prodID, "" , "width:200;height:200;menu:none;status:none");
		
}

function selectImage()
{  
	if(pageHTML != undefined && pageHTML!="") {
		pageHTML.focus()
		rngSelection = pageHTML.document.selection.createRange()
		returnVal = showModalDialog( "selectimages.asp", "" , "font-family:Verdana;font-size:10;dialogWidth:24em;dialogHeight:60em;help:no;minimize:no;maximize:no;center:yes");
		
		if (returnVal!=undefined) {
			strHTML = "<img src='"+returnVal[0]+"'"
			if (returnVal[1]) strHTML += " class=imgrand "
			if (returnVal[2]) strHTML += " align=left "
			if (returnVal[3]) strHTML += " align=right "
			strHTML += ">"

			rngSelection.pasteHTML(strHTML);
		}
	} else {
		alert("Zet de cursor eerst de juiste positie waar de afbeelding moet worden ingevoegd.")
	}
}

function insertHeader(tag)
{  
	if(pageHTML != undefined && pageHTML!="") {
		if (tag!="") {
			pageHTML.focus()
			rngSelection = pageHTML.document.selection.createRange()
			rngSelection.pasteHTML("<"+tag+">"+rngSelection.htmlText+"</"+tag+">");
		}
	} else {
		alert("Zet de cursor eerst de juiste positie waar de afbeelding moet worden ingevoegd.")
	}
}

function div2hidden(objForm) {
	objForm.actie.value		= "update";			
	if (document.all.tags('div')['pageType']) {
		//EDIT PRODUCT PAGE
		
		objForm.intCategorie.value	= document.all.pageCategorie.value;	
		objForm.strType.value		= document.all.tags('div')['pageType'].innerText;		
		objForm.strDescription.value	= document.all.tags('div')['pageDescription'].innerHTML;		
		objForm.strStandardConfig.value = document.all.tags('div')['pageStandardConfig'].innerHTML;	
		objForm.strTechnical.value 	= document.all.tags('div')['pageTechnical'].innerHTML;	
		objForm.strOptionals.value	= document.all.tags('div')['pageOptionals'].innerHTML;		

		objForm.strMovie.value		= document.all.tags('div')['pageMovie'].innerText;		
		
		//objForm.strDownload1.value	= document.all.tags('div')['pageDownload1'].innerText;		
		//objForm.strDownload2.value	= document.all.tags('div')['pageDownload2'].innerText;		
	}
	
	if (document.all.tags('div')['pageTekst']) {
		//EDIT TEKST PAGE
		objForm.strTekst.value		= document.all.tags('div')['pageTekst'].innerHTML;
	}
}

function cleanup_pasted(objname) {
	var mytext = window.clipboardData.getData('Text');
	window.clipboardData.clearData('Text');
	window.clipboardData.clearData('HTML');
	window.clipboardData.setData('Text', mytext);
}

function over(element) {
	element.style.borderStyle= "solid";
	element.style.borderWidth = "1px";
	element.style.borderColor = "#000000";
	element.style.backgroundColor = "#F1F1F1";
	element.style.cursor = "hand";
}

function out(element) {
	element.style.borderColor = "#CCCCCC";
	element.style.backgroundColor = "#CCCCCC"
	element.style.cursor = "default";
}

function InsertTable() {
	if(pageHTML != undefined && pageHTML!="") {
		pageHTML.focus()
		rngSelection = pageHTML.document.selection.createRange()

		returnVal = showModalDialog( "./instable.asp", pageHTML, "font-family:Verdana; font-size:12; dialogWidth:37em; dialogHeight:13em help:no;minimize:no;maximize:no;center:yes");
		pageHTML.document.selection.clear();

		rngSelection.pasteHTML(returnVal);
	} else {
		alert("Zet de cursor eerst de juiste positie waar de afbeelding moet worden ingevoegd.")
	}
}