//tab mouseovers
function changeTab(which) {
	document.getElementById(which).src = "/images/"+which+"_over.png";
}
function changeTabBack(which) {
	document.getElementById(which).src = "/images/"+which+"_active.png";
}

// bookmark script
function CreateBookmarkLink(dn,ai,rc,wl) {
	url = dn;
	title = "Videoland On Demand";   
	
	if (ai!="") {
		url=url+"?ai="+ai;
		if (rc!="") {
			url=url+"&refcode="+rc;
		}
		if (wl!="") {
			title = "Videoland On Demand";   	
			url=url+"&version="+wl;
		}
	}

	if (window.sidebar) { 	// Mozilla Firefox Bookmark	
		window.sidebar.addPanel(title, url,"");	
	}
	else if( window.external ) { // IE Favorite		
		window.external.AddFavorite(url,title)
	}	
} 

// show MSN presence
function showpresence(presence)
{
  if(presence.statusText == 'Online'){
	if(document.getElementById("msnchat")){
		document.getElementById("msnchat").style.display = "inline";
	}
	if(document.getElementById("msnchattop")) {
		document.getElementById("msnchattop").style.display = "inline";
	}
	if(document.getElementById("msnchattopspacer")) {
		document.getElementById("msnchattopspacer").style.display = "inline";
	}
  }
  else {
	if(document.getElementById("msnchatoffline")){
		document.getElementById("msnchatoffline").style.display = "inline";
	}
  }
}
//show overlay windows with delay
function ShowOverlayDelayed(wat) {
	setTimeout ("ShowOverlay(\'"+wat+"\')", 1500);
}
//show overlay windows
function ShowOverlay(wat) {
	if(document.getElementById(wat).style.display == "block"){
		document.getElementById(wat).style.display = "none";
		}
	else{
		document.getElementById(wat).style.display = "block";
	}
}
//keep overlay windows
function KeepOverlay(wat) {
	document.getElementById(wat).style.display = "block";
}

//show overlay windows
function ShowOverlayOpen(wat) {
		document.getElementById(wat).style.display = "block";
}
//hide overlay windows
function ShowOverlayClose(wat) {
	document.getElementById(wat).style.display = "none";
}
//show submenu 
function ShowSubmenuOpen(wat) {
		document.getElementById(wat).style.visibility = "visible";
}
//hide submenu
function ShowSubmenuClose(wat) {
	document.getElementById(wat).style.visibility = "hidden";
}


//show/hide contactform items
function ShowContactItems(wat, welk) {
		document.getElementById("bmtelefoon").style.display = "none";
		document.getElementById("bmsms").style.display = "none";
		document.getElementById("bmideal").style.display = "none";
		document.getElementById("bmcc").style.display = "none";
		document.getElementById("bmpaypal").style.display = "none";
		document.getElementById("bmwallie").style.display = "none";
		document.getElementById("bmmrcash").style.display = "none";
		if(welk == 1){
			if(wat == 0 ){
				document.getElementById('thuisbios').style.display = "";
			}
			else if (wat == 4){
				location.href="https://www.videolandondemand.com/philips";
			}
			else{
				document.getElementById('thuisbios').style.display = "none";
				document.getElementById('thuisbiosproblem').style.display = "none";
				document.getElementById('betaalmethode').style.display = "none";
			}
		}
		if(welk == 2){
			if(wat == 1 || wat == 2 || wat == 3){
				document.getElementById('thuisbiosproblem').style.display = "";
			}
			else{
				document.getElementById('thuisbiosproblem').style.display = "none";
				document.getElementById('betaalmethode').style.display = "none";
			}
		}
		if(welk == 3){
			if(wat == 1 || wat == 2){
				document.getElementById('betaalmethode').style.display = "";
			}
			else{
				document.getElementById('betaalmethode').style.display = "none";
			}
		}
		if(welk == 4){
			if(wat == 2){
				document.getElementById('bmtelefoon').style.display = "";
			}
			if(wat == 3){
				document.getElementById('bmsms').style.display = "";
			}
			if(wat == 4){
				document.getElementById('bmideal').style.display = "";
			}
			if(wat == 5 || wat ==6){
				document.getElementById('bmcc').style.display = "";
			}
			if(wat == 7){
				document.getElementById('bmpaypal').style.display = "";
			}
			if(wat == 8){
				document.getElementById('bmwallie').style.display = "";
			}
			if(wat == 9 || wat == 10 ||wat == 11){
				document.getElementById('bmmrcash').style.display = "";
			}
		}
		//if(wat.substring(0,2) == "bm"){
		//	document.getElementById(wat).style.display = "";
		//}
}
//check stuff for contact form
function CheckHardware(){
var browserscontactform = "";
	BrowserCheck();	
	//browser detection
	function BrowserCheck() {
		if ((navigator.userAgent.indexOf("Chrome") != -1) && (navigator.userAgent.indexOf("Opera") == -1)) {
			browserscontactform = "Chrome";
		}
		else if (navigator.userAgent.indexOf('Opera')!=-1){
			browserscontactform = "Opera";
		}
		else if (navigator.appName.indexOf('Microsoft')!=-1 && browserscontactform !== "Opera"){
			browserscontactform = "IE";
			var version = navigator.appVersion;
			var msPos = version.indexOf('MSIE ');
			var versNrt = parseInt(version.substring(msPos+5));
		}
		else if (navigator.appName.indexOf('Netscape')!=-1 && browserscontactform !== "Opera" && browserscontactform !== "IE"&& browserscontactform !== "Chrome"){
			browserscontactform = "Netscape/Firefox";
		}
		else{
			browserscontactform = "Unknown";
		}
		if (window.versNrt === undefined){
			versNrt = "";
		}
		document.getElementById('Browser').value = browserscontactform + versNrt;
		testCookie();
	}
	
	function testCookie(){
		// Trap error generated when trying to read cookie
		window.onerror = testCookie_err;
	
		WriteCookie('test','test');
		if (ReadCookie('test') == null) {
			document.getElementById('Cookie').value = "NIET OK";
		} else {
			document.getElementById('Cookie').value = "OK";
		}
		checkResolution();
	}
	function ReadCookie(name) {
		var start = document.cookie.indexOf(name + "=");
	
		if(start == -1) return null;
		 
		start = document.cookie.indexOf("=",start) + 1;
		var end = document.cookie.indexOf(";",start);
	
		if( end == -1 )	end = document.cookie.length;
		 
		var value = unescape(document.cookie.substring(start,end));
	
		return value;
	}
	
	function WriteCookie(name, value) {
		document.cookie = name + "=" + value;
	}
	
	// Trap error generated when trying to read / write cookie
	function testCookie_err(msg, url, line) {
		checkResolution();
	}
	
	function checkResolution(){
		if ((screen.width>=1024) && (screen.height>=720)){
			document.getElementById('Resolution').value = screen.width + "x" + screen.height;
		}
		else{
			document.getElementById('Resolution').value = "Lager dan 1024 x 720";
		}
		testMediaplayer();
	}	
	function testMediaplayer(){
		if (browserscontactform == "IE"){
			// Trap error generated when checking wmp
			window.onerror = testMediaplayer_err;
	
			var fHasWMP7  = (WMP7.URL = "x");
	
			if (fHasWMP7) {
				document.getElementById('WMPversion').value = parseInt(WMP7.versionInfo);
			}else{
				document.getElementById('WMPversion').value = "geen WMP gedetecteerd";
			}
			checkWmpIndivid();
		}
		else{
			var WMPlayer9 = PluginDetect.isMinVersion('WindowsMediaPlayer', "9,0,0,0");
			var WMPlayer10 = PluginDetect.isMinVersion('WindowsMediaPlayer', "10,0,0,0");
			var WMPlayer11 = PluginDetect.isMinVersion('WindowsMediaPlayer', "11,0,0,0");
			 
			if (WMPlayer9 == 1){
				if(WMPlayer9 == 1){
					document.getElementById('WMPversion').value = "Versie 9";
				}
				if(WMPlayer10 == 1){
					document.getElementById('WMPversion').value = "Versie 10";
				}
				if(WMPlayer11 == 1){
					document.getElementById('WMPversion').value = "Versie 11";
				}
				checkWmpIndivid();
			}
			else if (WMPlayer9 == 0){
				// Windows Media Player installed but version is unknown. Browsers do not reveal the WinMediaPlayer version in their navigator array,
				// they only show whether the plugin is installed or not. It is thus the user's responsibility to make sure that their Media Player is up to date.
				document.getElementById('WMPversion').value = "Versie onbekend";
				checkWmpIndivid();
			}
			else if (WMPlayer9 == -1){
			   if (PluginDetect.isMinVersion('WindowsMediaPlayer', '0') >= 0){
			   //Windows Media Player installed but version is too low
				document.getElementById('WMPversion').value = "Versie is lager dan 9";
			   }
			   else{
			   //else Windows Media Player not installed/enabled			
				document.getElementById('WMPversion').value = "Geen WMP geinstalleerd";
				}
			}
			else if (WMPlayer9 == -2){
			   // ActiveX is disabled			
				document.getElementById('WMPversion').value = "Versie onbekend";
				checkWmpIndivid();
			}
			else{
				document.getElementById('WMPversion').value = "Geen info";
				checkWmpIndivid();
			}
		}
	}
	
	// Trap error generated when trying to read / write cookie
	function testMediaplayer_err(msg, url, line) {
		checkWmpIndivid();
	}
	
	function checkWmpIndivid(){
		if (browserscontactform == "IE"){
		
			var drmVersion = '';
			//testmeddelande.innerHTML = 'Kollar DRM version.';
			
			var WMPindivid = false;
		
			if (netobj == 'undefined') {
			// Force failure.
				drmVersion = '';
			} else {
				drmVersion = netobj.GetDRMSecurityVersion();
			}
			
			if (drmVersion != ''){
				var arDrmVersion1 = drmVersion.split('.', 2);
				var arDrmVersion2 = drmVersion.split('.', 4);
				
				var sDrmVersion =  arDrmVersion1.join('.');
				var drmMajorVersion = parseFloat(sDrmVersion);
				if (drmMajorVersion >= 2.2) {
					// Fourth version digit is set to 1 if individualized
					if (arDrmVersion2[3] == 1) {
						document.getElementById('Individualisation').value = "Ja";
					}
				}
			} else {
					document.getElementById('Individualisation').value = "Nee";
			}
		}
		else{
			document.getElementById('Individualisation').value = "Kon niet gemeten worden";
		}
	}
}

//open popups
function popups(pwidth, pheight, url, scrollbars) {
	var left = (window.screen.width/2 - pwidth/2);
	var top = (screen.height/2 - pheight/2);
	newwindow=window.open(''+url+'','','width='+pwidth+',height='+pheight+',left='+left+',top='+top+',scrollbars='+scrollbars+',dependent=yes,alwaysRaised=1');
}


//detect browser
var detect = navigator.userAgent.toLowerCase();  
var OS,browser,version,total,thestring;    

if (checkIt('konqueror'))  {   
	browser = "Konqueror";   
	OS = "Linux";  
}  
else if (checkIt('safari')) 
	browser = "Safari";  
else if (checkIt('omniweb')) 
	browser = "OmniWeb";  
else if (checkIt('opera')) 
	browser = "Opera";  
else if (checkIt('webtv')) 
	browser = "WebTV";  
else if (checkIt('icab')) 
	browser = "iCab";  
else if (checkIt('msie')) 
	browser = "Internet Explorer";  
else if (!checkIt('compatible'))  {   
	browser = "Netscape Navigator";   
	version = detect.charAt(8);  
}  
else browser = "An unknown browser";    

if (!version) version = detect.charAt(place + thestring.length);    if (!OS)  {   if (checkIt('linux')) OS = "Linux";   else if (checkIt('x11')) OS = "Unix";   else if (checkIt('mac')) OS = "Mac";   else if (checkIt('win')) OS = "Windows";   else OS = "an unknown operating system";  }    function checkIt(string)  {   place = detect.indexOf(string) + 1;   thestring = string;   return place;  }  

// creating cookies for favorites
function createCookie(name,value,days) {
		var x = readCookie(name)
		if (x) {
			x = x+","+value;
			arr_value = x.split(",");
			arr_value = unique(arr_value);
			for (var i = 0; i < arr_value.length; i++) {
				if(i == 0){
				value = arr_value[i];
				}
				else{
				value = value+","+arr_value[i];
				}
			} 
		}
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
		if (days !== -1){
			if (name == 'favorites'){
				alert("Deze film is toegevoegd aan je favorieten!");
				}
			else if (name == 'favoritetrailers'){
				alert("Deze trailer is toegevoegd aan je favorieten!");
				}
			else if (name == 'favoritewebcams'){
				alert("Dit model is toegevoegd aan je favorieten!");
				}
			else if (name == 'blockedwebcams'){
				alert("Dit model wordt niet meer getoond!");
				location.reload(true);
				}
			else {
				}
		}
}
	
function changeCookie(name,value,days) {
		var x = readCookie(name)
		if (x) {
			arr_value = x.split(",");
			arr_value = unique(arr_value);
			deleteitem = value;
			$a = 0;
			for (var i = 0; i < arr_value.length; i++) {
					if (arr_value[i] == deleteitem){
						//verwijder
					}
					else{
							if($a == 0){
							value = arr_value[i];
							}
							else{
							value = value+","+arr_value[i];
							}
							$a++;
					}
			} 
		}
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else var expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
		if (arr_value.length == 1) {
			eraseCookie(name);
		}
		location.reload(true);
}
	
function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
}
	
function eraseCookie(name) {
		createCookie(name,"",-1);
}

// part of cookie script
function unique(a) {
		tmp = new Array(0);
		for(i=0;i<a.length;i++){
			if(!contains(tmp, a[i])){
				tmp.length+=1;
				tmp[tmp.length-1]=a[i];
			}
		}
		return tmp;
}

// part of cookie script
function contains(a, e) {
		for(j=0;j<a.length;j++)if(a[j]==e)return true;
		return false;
}
	
/////////enkel betaalscherm

function toTop(){
		if (parent) parent.location.hash = '#';
}

// general check if numbers are present in form field
function checkForNumbers(naampje) {
		var nummer = 0;
		for (i=0;i<naampje.length;i++) {
			if (!isNaN(naampje.charAt(i)) && naampje.charAt(i)!=" ") {
				nummer = 1;
			}
		}
		return nummer;
}

// wis de standaard tekst in invoervelden
function clearDefault(el) {
	  if (el.defaultValue==el.value) el.value = ""
}

// validate review
function validate(){
		var form = document.forms.reviewForm;
		var radio = form.rating;
		for (var i=0;i<radio.length;i++)
		{
			if (radio[i].checked)
			var checked = true;
		}
		if(checked == true)
		{
			return true;
		}
		else
		{
			alert('Je dient bij een review tenminste een cijfer te geven.');
			return false;
	
		}
}

// show active channel in topmenu
function myCurrent(wat, subject) {
	//f_banner(wat,subject);		
		if (wat == "klantenservice"){ 
			if (subject == "faq") {
				document.getElementById('faq').style.display="block";
			}
			if (subject == "pctv" || subject == "mce" || subject == "pczapper" || subject == "doehetzelf" || subject == "draadloos" || subject == "pctv_a" || subject == "pctv_b" || subject == "pctv_c" || subject == "pctv_d" || subject == "pctv_e" || subject == "pctv_geluid" || subject == "pctv_problemen") {
				document.getElementById('pctv').style.display="block";
			}
			if (subject == "mijngegevens" || subject == "dezemaand" || subject == "facturen" || subject == "persoonsgegevens" || subject == "abonnementen" || subject == "emailadres") {
				document.getElementById('mijngegevens').style.display="block";
			}
			if (subject == "divx" || subject == "divx_afspelen" || subject == "divx_register" || subject == "divx_to_go") {
				document.getElementById('divx').style.display="block";
			}
		}
}

// check 'mijn gegevens' form
function checkMijngegevensForm() {
		doorgaan = "true";
	
		//straatnaam check
		if (document.displayform.straatnaam.value.length>0 && checkForNumbers(document.displayform.straatnaam.value)) {
			doorgaan = "false";
			foutmelding = "Straatnaam mag geen cijfers bevatten.";
			document.displayform.straatnaam.focus();
		}else if (document.displayform.straatnaam.value.length>0 && document.displayform.straatnaam.value.length<2) {
			doorgaan = "false";
			foutmelding = "Een straatnaam heeft minimaal 2 karakters.";
			document.displayform.straatnaam.focus();
		//huisnummer check
		}else if (document.displayform.huisnummer.value.length>0 && isNaN(document.displayform.huisnummer.value)) {
			doorgaan = "false";
			foutmelding = "Een huisnummer mag alleen bestaan uit cijfers.";
			document.displayform.huisnummer.focus();
		//telefoonnummer check
		}else if (document.displayform.woonplaats.value.length>0 && checkForNumbers(document.displayform.woonplaats.value)) {
			doorgaan = "false";
			foutmelding = "Een woonplaats mag geen cijfers bevatten.";
			document.displayform.woonplaats.focus();
		}else if (document.displayform.woonplaats.value.length>0 && document.displayform.woonplaats.value.length<2) {
			doorgaan = "false";
			foutmelding = "Een woonplaats heeft minimaal 2 karakters.";
			document.displayform.woonplaats.focus();
		}else if (document.displayform.telefoonnummer.value.length>0 && isNaN(document.displayform.telefoonnummer.value)){
			doorgaan = "false";
			foutmelding = "Een telefoonnummer mag alleen uit cijfers bestaan.";
			document.displayform.telefoonnummer.focus();
		}else if (isNaN(document.displayform.newpin.value.charAt(0)) || isNaN(document.displayform.newpin.value.charAt(1)) || isNaN(document.displayform.newpin.value.charAt(2)) || isNaN(document.displayform.newpin.value.charAt(3))){
			doorgaan = "false";
			foutmelding = "De toegangscode dient uit 4 cijfers te bestaan.";
			document.displayform.newpin.value = '';
			document.displayform.newpincheck.value = '';
			document.displayform.newpin.focus()
		}else if(document.displayform.newpin.value.length>0 && document.displayform.newpin.value.length < 4) {
			doorgaan = "false";
			foutmelding = "De toegangscode dient uit 4 cijfers te bestaan.";
			document.displayform.newpin.value = '';
			document.displayform.newpincheck.value = '';
			document.displayform.newpin.focus()
		}else if(document.displayform.newpin.value != document.displayform.newpincheck.value) {
			doorgaan = "false";
			foutmelding = "De ingevoerde toegangscodes zijn niet gelijk. Voer beide opnieuw in.";
			document.displayform.newpin.value = '';
			document.displayform.newpincheck.value = '';
			document.displayform.newpin.focus();
		}
		//onderscheid NL en BE
		if (document.displayform.land.value == ""){
			doorgaan = "false";
			foutmelding = "Er is geen land ingevuld.";
		}
		if (document.displayform.land.value == "België"){
			if (document.displayform.postcode.value.length>0 && (isNaN(document.displayform.postcode.value))){
				doorgaan = "false";
				foutmelding = "Er is geen nummerieke postcode ingevuld.";
				document.displayform.postcode.focus();
			}else if (document.displayform.postcode.value.length<4 || document.displayform.postcode.value.length>4) {
				doorgaan = "false";
				foutmelding = "Een postcode bestaat uit 4 cijfers.";
				document.displayform.postcode.focus();
			}else if (document.displayform.telefoonnummer.value.length>0 && document.displayform.telefoonnummer.value.length<9){
				doorgaan = "false";
				foutmelding = "Een telefoonnummer moet uit 9 of 10 cijfers bestaan.";
				document.displayform.telefoonnummer.focus();
			}
		}
		else{
			//postcode check
			if (document.displayform.postcode.value.length>0 && document.displayform.postcode.value.length<6) {
				doorgaan = "false";
				foutmelding = "Een postcode heeft 6 posities.";
				document.displayform.postcode.focus();
			}else if (document.displayform.postcode.value.length>0 && (isNaN(document.displayform.postcode.value.charAt(0)) || isNaN(document.displayform.postcode.value.charAt(1)) || isNaN(document.displayform.postcode.value.charAt(2)) || isNaN(document.displayform.postcode.value.charAt(3)) || !isNaN(document.displayform.postcode.value.charAt(4)) || !isNaN(document.displayform.postcode.value.charAt(5)))){
				doorgaan = "false";
				foutmelding = "Een postcode mag alleen bestaan uit vier cijfers gevolgd door twee letters.";
				document.displayform.postcode.focus();
			}else if (document.displayform.telefoonnummer.value.length>0) {
				if (document.displayform.telefoonnummer.value.length<10){
					doorgaan = "false";
					foutmelding = "Een telefoonnummer moet uit 10 cijfers bestaan.";
					document.displayform.telefoonnummer.focus();
				}else if ((document.displayform.telefoonnummer.value.substr(0,4) == "0900") || (document.displayform.telefoonnummer.value.substr(0,4) == "0906") || (document.displayform.telefoonnummer.value.substr(0,4) == "0909")) {
					doorgaan = "false";
					foutmelding = "Het opgegeven telefoonnummer is niet toegestaan.";
					document.displayform.telefoonnummer.focus();
				}else if (document.displayform.telefoonnummer.value.substr(0,1) != "0") {
					doorgaan = "false";
					foutmelding = "Een telefoonnummer moet met een 0 beginnen";
					document.displayform.telefoonnummer.focus();
				}else if (document.displayform.telefoonnummer.value.substr(0,2) == "00") {
					doorgaan = "false";
					foutmelding = "Een telefoonnummer mag niet met 00 beginnen";
					document.displayform.telefoonnummer.focus();
				}
			}
		}
		if (doorgaan=="true") {
			return true;
		}else {
			alert(foutmelding);
			return false;
		}	
}

function checkPostcalCode() {
	doorgaan = "true";
		
	if (isNaN(document.displayform.postcode.value)){
		doorgaan = "false";
		foutmelding = "Er is geen nummerieke postcode ingevuld.";
		document.displayform.postcode.focus();
	}else if (document.displayform.postcode.value.length<4 || document.displayform.postcode.value.length>4) {
		doorgaan = "false";
		foutmelding = "Voer enkel de 4 cijfers van de postcode in";
		document.displayform.postcode.focus();
	}else if (parseInt(document.displayform.postcode.value) < 1000) {
		doorgaan = "false";
		foutmelding = "Voer een geldige postcode in";
		document.displayform.postcode.focus();		
	}

	if (doorgaan=="true") {
		return true;
	}else {
		alert(foutmelding);
		return false;
	}	
}

// Slideshow in details page start

var slideshow2_noFading = false;
var slideshow2_timeBetweenSlides = 3000;	// Amount of time between each image(1000 = 1 second)
var slideshow2_fadingSpeed = 10;	// Speed of fading	(Lower value = faster)
	
var slideshow2_galleryContainer;	// Reference to the gallery div
var slideshow2_galleryWidth;	// Width of gallery
var slideshow2_galleryHeight;	// Height of galery
var slideshow2_slideIndex = -1;	// Index of current image shown
var slideshow2_slideIndexNext = false;	// Index of next image shown
var slideshow2_imageDivs = new Array();	// Array of image divs(Created dynamically)
var slideshow2_currentOpacity = 100;	// Initial opacity
var slideshow2_imagesInGallery = false;	// Number of images in gallery
var Opera = navigator.userAgent.indexOf('Opera')>=0?true:false;

function createParentDivs(imageIndex){
	if(imageIndex==slideshow2_imagesInGallery){			
			showGallery();
	}else{
		var imgObj = document.getElementById('galleryImage' + imageIndex);	
		if(Opera)imgObj.style.position = 'static';
		slideshow2_imageDivs[slideshow2_imageDivs.length] =  imgObj;
		imgObj.style.visibility = 'hidden';	
		imageIndex++;
		createParentDivs(imageIndex);	
	}		
}
	
function showGallery(){
	if(slideshow2_slideIndex==-1)slideshow2_slideIndex=0; else slideshow2_slideIndex++;	// Index of next image to show
	if(slideshow2_slideIndex==slideshow2_imageDivs.length)slideshow2_slideIndex=0;
	slideshow2_slideIndexNext = slideshow2_slideIndex+1;	// Index of the next next image
	if(slideshow2_slideIndexNext==slideshow2_imageDivs.length)slideshow2_slideIndexNext = 0;
	slideshow2_currentOpacity=100;	// Reset current opacity
	// Displaying image divs
	slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'visible';
	if(Opera)slideshow2_imageDivs[slideshow2_slideIndex].style.display = 'inline';
	if(navigator.userAgent.indexOf('Opera')<0){
		slideshow2_imageDivs[slideshow2_slideIndexNext].style.visibility = 'visible';
	}
	if(document.all){	// IE rules
		slideshow2_imageDivs[slideshow2_slideIndex].style.filter = 'alpha(opacity=100)';
		slideshow2_imageDivs[slideshow2_slideIndexNext].style.filter = 'alpha(opacity=1)';
	}else{
		slideshow2_imageDivs[slideshow2_slideIndex].style.opacity = 0.99;	// Can't use 1 and 0 because of screen flickering in FF
		slideshow2_imageDivs[slideshow2_slideIndexNext].style.opacity = 0.01;
	}		
	setTimeout('revealImage()',slideshow2_timeBetweenSlides);		
}
	
function revealImage(){
	if(slideshow2_noFading){
		slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';
		if(Opera)slideshow2_imageDivs[slideshow2_slideIndex].style.display = 'none';
		showGallery();
		return;
	}
	slideshow2_currentOpacity--;
	if(document.all){
		slideshow2_imageDivs[slideshow2_slideIndex].style.filter = 'alpha(opacity='+slideshow2_currentOpacity+')';
		slideshow2_imageDivs[slideshow2_slideIndexNext].style.filter = 'alpha(opacity='+(100-slideshow2_currentOpacity)+')';
	}else{
		slideshow2_imageDivs[slideshow2_slideIndex].style.opacity = Math.max(0.01,slideshow2_currentOpacity/100);	// Can't use 1 and 0 because of screen flickering in FF
		slideshow2_imageDivs[slideshow2_slideIndexNext].style.opacity = Math.min(0.99,(1 - (slideshow2_currentOpacity/100)));
	}
	if(slideshow2_currentOpacity>0){
		setTimeout('revealImage()',slideshow2_fadingSpeed);
	}else{
		slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';	
		if(Opera)slideshow2_imageDivs[slideshow2_slideIndex].style.display = 'none';		
		showGallery();
	}
}
	
function initImageGallery(){
	slideshow2_galleryContainer = document.getElementById('imageSlideshowHolder');
	slideshow2_galleryWidth = slideshow2_galleryContainer.clientWidth;
	slideshow2_galleryHeight = slideshow2_galleryContainer.clientHeight;
	galleryImgArray = slideshow2_galleryContainer.getElementsByTagName('IMG');
	for(var no=0;no<galleryImgArray.length;no++){
		galleryImgArray[no].id = 'galleryImage' + no;
	}
	slideshow2_imagesInGallery = galleryImgArray.length;
	createParentDivs(0);		
}

// Slideshow in details page stop

function trim(inputString) {

	if (typeof inputString != "string") {
		return inputString;
	}
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	while (ch == " ") { // Check for spaces at the beginning of the string
		retValue = retValue.substring(1, retValue.length);
		ch = retValue.substring(0, 1);
	}
	ch = retValue.substring(retValue.length-1, retValue.length);
	while (ch == " ") { // Check for spaces at the end of the string
		retValue = retValue.substring(0, retValue.length-1);
		ch = retValue.substring(retValue.length-1, retValue.length);
	}
	while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
		retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
	}
	return retValue; // Return the trimmed string back to the user
}

	var version = navigator.appVersion;
	var msPos = version.indexOf('MSIE ');
	var versNr = parseInt(version.substring(msPos+5));

// show png images in IE6 or lower for tabs 
	function replaceImgpngTab(img, id){
		if (browser == "Internet Explorer" && versNr <= 6.0){ 
			if(!id){id="";}
			document.getElementById(img).src = "/images/blank.gif"; 
			document.getElementById(img).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/" + img + id + ".png', sizingMethod='image')"; 
		}
	}

// show png images in IE6 or lower
	function replaceImgpng(img, id){
		if (browser == "Internet Explorer" && versNr <= 6.0){ 
		which= img;
		if (id){ which = img + id;}
		document.getElementById(which).src = "/images/blank.gif"; 
		document.getElementById(which).style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/" + img + ".png', sizingMethod='image')"; 
		}
	}

	// less pretty, but needed for some starratings, because no unique ID is present
	function replaceImg(url,target,img,imgblank,title,align,valign){
		if(url){
			document.write('<a href="'+url+'" target="'+target+'">');
		}
			if (browser == "Internet Explorer" && versNr <= 6.0){   
				document.write("<img src=\"/images/"+imgblank+"\" alt=\""+title+"\" title=\""+title+"\" border=\"0\" align=\""+align+"\" valign=\""+valign+"\" style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/"+img+"', sizingMethod='image');\" >");  
			}  
			else {   
				document.write('<img src="/images/'+img+'" alt="'+title+'" title="'+title+'" border="0" align="'+align+'" valign="'+valign+'" />');  
			}  
		if(url){
			document.write('</a>');
		}
	
	
	}
/* movie details page */
// swap description, details, review

function moviedetailswap(wat) {
	if(wat == 4){ 
		watt = 3; 
	}	
	else{	
		watt = wat;	
	}
	document.getElementById('btnmoviedetail1').src ="/images/tab_1"+watt+".gif";
	document.getElementById('btnmoviedetail2').src ="/images/tab_2"+watt+".gif";
	document.getElementById('btnmoviedetail3').src ="/images/tab_3"+watt+".gif";
	document.getElementById('moviedetail1').style.display = "none";
	document.getElementById('moviedetail2').style.display = "none";
	document.getElementById('moviedetail3').style.display = "none";
	document.getElementById('moviedetail4').style.display = "none";
	document.getElementById('moviedetail'+wat+'').style.display = "block";
}

//forward select box contact page

function optionurl(wat){
	if(wat == "philips"){
		location.href="https://www.videolandondemand.com/philips";
	}
}

