function fixextraclick() {
	var theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) {
		theObjects[i].outerHTML = theObjects[i].outerHTML;
	}

}

function rescale(movid,w,h) {
	if (w> 0 && h > 0) {
		obmov =	document.getElementById(movid)
		if (typeof(obmov) != 'undefined' && obmov != null) {
			obmov.width = w
			obmov.height = h
		}
		obmov =	document.getElementById("emb"+ movid)
		if (typeof(obmov) != 'undefined' && obmov != null) {
			obmov.width = w
			obmov.height = h
		}
	}
}

function inlinemovie(img,movid,initwidth,initheight,adserver,adlink,ad,movie,bktitle,suggestionsxml,mailtosubject,mailtobody) {

	var res =  '<' + 'object id="' + movid +'" ' + "\n";
	res += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="player2" width="' + (initwidth+8) + '" height="'+ (initheight+29) +'" align="middle">'+ "\n"
	res += '<' + 'param name="allowScriptAccess" value="always" />'+ "\n"
	res += '<' + 'param name="movie" value="http://www.boostdigital.nl/ptrlhd/dplayer.swf?image=http://www.petrolhead.nl/beelden/'+ escape(img) +'&initwidth=' + escape(initwidth) + '&initheight=' + escape(initheight) +'&plid=' + escape(movid) + '&adSERVER=' + escape(adserver) + '&adLINK=' + escape(adlink) + '&adURL=' + escape(ad) + '&clipURL=' + escape(movie) + '&suggestionsXML=' +escape(suggestionsxml) + '&mailtosubject=' +escape(mailtosubject) + '&mailtobody=' +escape(mailtobody) + '&bktitle=' + escape(bktitle) +'" />'+ "\n"
	res += '<' + 'param name="loop" value="false" />'+ "\n"
	res += '<' + 'param name="menu" value="false" />'+ "\n"
	res += '<' + 'param name="quality" value="high" />'+ "\n"
	res += '<' + 'param name="scale" value="noscale" />'+ "\n"
	res += '<' + 'param name="autostart" value="true" />'+ "\n"
	res += '<' + 'param name="salign" value="lt" />'+ "\n"
	res += '<' + 'param name="bgcolor" value="#ffffff" />'+ "\n"
	res += '<' + 'embed id="emb' + movid + '"  src="http://www.boostdigital.nl/ptrlhd/dplayer.swf?image=http://www.petrolhead.nl/beelden/'+ escape(img) +'&initwidth=' + escape(initwidth) + '&initheight=' + escape(initheight) +'&plid=' + escape(movid) + '&adSERVER=' + escape(adserver) + '&adLINK=' + escape(adlink) + '&adURL=' + escape(ad) + '&clipURL=' + escape(movie) + '&suggestionsXML=' +escape(suggestionsxml) +'&mailtosubject=' +escape(mailtosubject) + '&mailtobody=' +escape(mailtobody) + '&bktitle=' + escape(bktitle) +'" loop="false" '+ "\n"
	res += 'menu="false" quality="high" scale="noscale" '+ "\n"
	res += 'salign="lt" bgcolor="#7d2122" '+ "\n"
	res += 'width="'+ (initwidth+8)+'" height="'+ (initheight + 25) +'" swLiveConnect=false id="player2" name="player2" '+ "\n"
	res += 'align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" '+ "\n"
	res += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />'+ "\n"
	res += '<' + '/object>'+ "\n"

	return res;
}

function showpop (img,title, initwidth,initheight,movid,adserver,adlink,ad,movie,bktitle,suggestionsxml,mailtosubject,mailtobody) {
	w = window.open("","pop","width=" + (initwidth + 8) + ",height=" + (initheight + 25))
	if (typeof(w) != "undefined" && w != null) {
		w.document.write ('<' + 'HTML' + '><'+ 'head' + '><' + 'title' + '>' + title + '<' + '/title' + '><' + '/head'+ '>' + "\n");
		w.document.write ('<' + 'script'+ '>' + 'function rescale(movid,w,h) {'+ "\n")
		w.document.write ('	obmov =	document.getElementById(movid)'+ "\n")
		w.document.write ('     if (typeof(obmov) != "undefined" && obmov != null) {'+ "\n")
		w.document.write ('	obmov.width= w '+ "\n")
		w.document.write ('	obmov.height= h'+ "\n")
		w.document.write ('	}')
		w.document.write ('	obmov =	document.getElementById("emb" + movid)'+ "\n")
		w.document.write ('     if (typeof(obmov) != "undefined" && obmov != null) {'+ "\n")
		w.document.write ('	obmov.width= w '+ "\n")
		w.document.write ('	obmov.height= h'+ "\n")
		w.document.write ('	}')
		w.document.write ('	window.resizeBy (w - document.body.clientWidth ,(h + 20) - document.body.clientHeight)'+ "\n")
		w.document.write ('}<'+ '/script' + '>'+ "\n")
		w.document.write ('<' + 'BODY style="margin:0;padding:0;">'+ "\n")
		w.document.write (inlinemovie(img,movid,initwidth,initheight,adserver,adlink,ad,movie,bktitle,suggestionsxml,mailtosubject,mailtobody))
		w.document.write ("</body></html>")
	}
	else {
		alert ('Disable popup blocker')
	}
}
