function doCheck(locate,theGenre){
	var start = locate.indexOf('=')+1;
	var stop = locate.indexOf('&');
	var getCheck = locate.substring(start,stop);
	start = getCheck.indexOf('Z3')+2;
	stop = getCheck.indexOf('NE');
	getCheck = getCheck.substring(start,stop);
	if(getCheck != '494n'){   //part of code
		switch(theGenre){
			case 'books':
				window.location.href='../CDP_04.html';//redirect to correct page
				break;
			case 'technical':
				window.location.href='../CDP_06.html';//redirect to correct page
				break;
			case 'pdfguide':
				window.location.href='../CDP_06.html';//redirect to correct page
				break;
			case 'testim_09':
				window.location.href='../CDP_04.html';//redirect to correct page
				break;
			case 'testim_10':
				window.location.href='../CDP_04.html';//redirect to correct page
				break;
			default:
				window.location.href='../CDP_01.html';//redirect to correct page
		}
	}
}

//WINDOW OPEN NO FRAMES or iFRAMES>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>STARTS
function windopen(URLorOTHER,LEFT,TOP,WIDTH,HEIGHT,TYPE){
	switch (TYPE){
		case "info"://everything off
		windoptions='status=no,toolbar=no,menu=no,scrollbars=no,resizable=no,';
			break;
		case "infonew"://everything off except scroll
			windoptions='status=no,toolbar=no,menu=no,scrollbars=no,resizable=no,';
			break;
		case "scrollresize":
			windoptions='status=no,toolbar=no,menu=no,scrollbars=yes,resizable=yes,';
			break;
		case "statusresize":
			windoptions='status=no,toolbar=no,menu=no,scrollbars=no,resizable=yes,';
			break;
		case "statusresizelocation":
			windoptions='status=no,location=yes,toolbar=no,menu=no,scrollbars=no,resizable=yes,';
			break;
		case "statuscrollresize":
			windoptions='status=yes,toolbar=no,menu=no,scrollbars=yes,resizable=yes,';
			break;
		case "statuscrollresizelocation":
			windoptions='status=yes,location=yes,toolbar=no,menu=no,scrollbars=yes,resizable=yes,';
			break;
		case "resizeonly":
			windoptions='status=no,toolbar=no,menu=no,scrollbars=no,resizable=yes,';
			break;
		case "noscroll":
			windoptions='status=yes,toolbar=yes,menu=yes,scrollbars=no,resizable=yes,';
			break;
		case "noscrollnoresize":
			windoptions='status=yes,toolbar=yes,menu=yes,scrollbars=no,resizable=no,';
			break;
		case "scrollnoresize":
			windoptions='status=yes,toolbar=yes,menu=yes,scrollbars=yes,resizable=no,';
			break;
		default:
			windoptions='status=yes,toolbar=yes,menu=yes,scrollbars=yes,resizable=yes,';
	}

	//centre in window SWITCH -take left and top match right and bottom and centre in window
	if(WIDTH==1000){
		WIDTH=screen.width-(LEFT);//AMENDED WAS just -50
		LEFT=LEFT/2;
	}
	
	if(HEIGHT==1000){
		HEIGHT=screen.height-(TOP);//AMENDED WAS JUST -100
		TOP=TOP/2;
	}

	//centre in window SWITCH - specific width and height
	if(LEFT==1000){
		LEFT=(screen.width-20-WIDTH)/2;//AMENDED WAS just -50
		//alert(LEFT);
	}
	
	if(TOP==1000){
		TOP=(screen.height-20-HEIGHT)/2;//AMENDED WAS JUST -100
	}

	//FULLSCREEN SWITCH
	if(WIDTH==0){
		WIDTH=screen.width-50-LEFT;//AMENDED WAS just -50
	}
	
	if(HEIGHT==0){
		HEIGHT=screen.height-100-TOP;//AMENDED WAS JUST -100
	}


	windowprops = "left="+(LEFT)+",top="+(TOP)+","+(windoptions)+"width=" + (WIDTH) + ",height=" + (HEIGHT);

	switch(URLorOTHER){
	case"ON_FLY"://GENERATE ON FLY
			gpopwindow = window.open("", "popwindow", windowprops);
			gpopwindow.document.open();
			gpopwindow.document.write(doOnFlyText);//text created elsewhere. doOnFlyText is var which is passed on thus:
			//										 javascript: var doOnFlyText=doGeneralInfo();               windopen('ON_FLY',20,10,500,350,'infoscroll');
			//																		^ generate the html in a js     ^and then it is used in this js here
			gpopwindow.document.close();
			break;
	case "":	//not implemented at present but could be used for EG one line of text etc
			alert("Debug Error"+URLorOTHER);// DEBUG ONLY similar to above
			gpopwindow = window.open("", "popwindow", windowprops);
			gpopwindow.document.open();
			gpopwindow.document.write("Hello world");//text
			gpopwindow.document.close();
			break;
	default://actual www URL - OPEN URL IN WINDOW
		gpopwindow = window.open(URLorOTHER, "popwindow", windowprops);
	}
}
//WINDOW OPEN NO FRAMES or iFRAMES<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<ENDS

