function insertVideo(base_url) {
//alert(base_url);
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="420" height="360">');
      document.write('<param name="movie" value="' + base_url + '/_video/iae_movie.swf" />');
	  document.write('<param name="wmode" value="transparent" />');
      document.write('<param name="quality" value="best" />');
      document.write('<embed src="' + base_url + '/_video/iae_movie.swf"  quality="best" swLiveConnect="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="420" height="360" wmode="transparent" />');
document.write('</object>');
} 


// - - - - - - - - - - - - - - - - - - - - - - - -//
// - - - - - - -  Print Window functions - - -    //
// - - - - - - - - - - - - - - - - - - - - - - -  //
function printWindow(){
  window.print();
}
function createPrintlink() {
	listitem = document.getElementById("print-page");
	if (listitem) {
		printlink = listitem.getElementsByTagName('a');
		printlink[0].onclick = function () { printWindow();};
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - -  //
// - - - - Target=_blank Links (rel=external)  - -  //
// - - - - - - - - - - - - - - - - - - - - - - - -  //
function externalLinks() {
	if (document.getElementsByTagName) {
		var anchors = document.getElementsByTagName( "a" );
		for (var i = 0; i < anchors.length; i++) {
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
				anchor.target = "_blank";
			}
		}
	}
}  




function emailPage(lang, base_url, URL) {
	if (lang == "eng") {
		theURL = base_url + "/english/emailpage/?URL=" + URL;
	} else if (lang == "de") {
		theURL = base_url + "/deutsch/emailpage/?URL=" + URL;
	} 
	newwindow=window.open(theURL,'name','width=570,height=440,top=15,left=15');
}
// - - - - - - - - - - - - - - - - - - - - - - - -  //
// - - - - - - -  FOR TABBED PAGES - - - - - -     //
// - - - - - - - - - - - - - - - - - - - - - - -  //

function showtab(which) {
	activetab(which);
	activepanel(which);
}
function activetab(which) {
	alltabs_off();
	idref = "t_" + which;
	if (document.getElementById(idref)) { document.getElementById(idref).className = 'active'; }
	
}
function activepanel(which) {
	allpanels_off();
	if (document.getElementById(which)) { document.getElementById(which).style.display = 'block'; }
}
function alltabs_off() {
	if (document.getElementById('t_tab1')) { document.getElementById('t_tab1').className = 'off'; }
	if (document.getElementById('t_tab2')) { document.getElementById('t_tab2').className = 'off'; }
	if (document.getElementById('t_tab3')) { document.getElementById('t_tab3').className = 'off'; }
	if (document.getElementById('t_tab4')) { document.getElementById('t_tab4').className = 'off'; }
	if (document.getElementById('t_tab5')) { document.getElementById('t_tab5').className = 'off'; }
	if (document.getElementById('t_tab6')) { document.getElementById('t_tab6').className = 'off'; }
}

function allpanels_off() {
	if (document.getElementById('tab1')) { document.getElementById('tab1').style.display = 'none'; }
	if (document.getElementById('tab2')) { document.getElementById('tab2').style.display = 'none'; }
	if (document.getElementById('tab3')) { document.getElementById('tab3').style.display = 'none'; }
	if (document.getElementById('tab4')) { document.getElementById('tab4').style.display = 'none'; }
	if (document.getElementById('tab5')) { document.getElementById('tab5').style.display = 'none'; }
	if (document.getElementById('tab6')) { document.getElementById('tab6').style.display = 'none'; }
}

// For PDF uploads etc.
function uploadData() {
	// this function should hide the page, and show another "uploading" message
	// like Flickr. It is called when the upload form is submitted
	document.getElementById("loading").style.display = "block";

}
function cancelUpload() {
	document.getElementById("loading").style.display = "none";
}


function popRemind(url) {
	newwindow=window.open(url,'remind','height=250,width=450,top=15,left=15');
	newwindow.focus();
}
function popTandC(url) {
	newwindow=window.open(url,'tandc','height=250,width=500,top=15,left=15, scrollbars=yes');
	newwindow.focus();
}

function popSample(url) {
	newwindow=window.open(url,'sample','height=500,width=800,top=15,left=15, scrollbars=yes');
	newwindow.focus();
}
// DO STUFF ONLOAD
window.onload=function(){

 createPrintlink();
 externalLinks();

}
