function PoPuP(tmpPage, w, h)
{
   //var w = 800;
   //var h = 250;
   var l = Math.floor((screen.width-w)/2);
   var t = Math.floor((screen.height-h)/2);
 
   newPoPuP=window.open(tmpPage,'tmpRicette','width=' + w + ',height='+ h + ',top=' + t + ',left=' + l+',scrollbars=yes,menubar=no,toolbar=no,status=no');
}

function execJS(t)
{
    var p1 = 0, p2 = 0, p3 = 0, p4 = 0;
    p1 = t.indexOf("<" + "script", 0);
    if(p1 == -1) return t;
    
    p2 = t.indexOf(">", p1 + 7) + 1;
    p3 = t.indexOf("<" + "/script>", p2);
    p4 = p3 + 9;
    
    var c = t.substring(p2, p3);
    var s = document.createElement("script");
    s.type = "text/javascript";
    s.text = c;
    document.getElementsByTagName("head")[0].appendChild(s);
    
    t = t.substring(0, p1) + t.substr(p4);
    return execJS(t);

}

function oPage(){
	//var tmpID = parseInt(Request.QueryString("id"));
	var tmpID = window.location.search.substring(1);

	switch (tmpID) {
	
		case 'id=1':
			my$('subheader2').innerHTML='<img src=\'../img/cam_01.jpg\' height=\'348px\' width=\'760px\' />';
			ajaxGetRand('cam.html',myTmpHandler,'container-center');
			break;
			
		case 'id=2':
			my$('subheader2').innerHTML='<img src=\'../img/cam_02.jpg\' height=\'348px\' width=\'760px\' />';
			ajaxGetRand('cam_classic.html',myTmpHandler,'container-center');
			break;
			
		case 'id=3':
			my$('subheader2').innerHTML='<img src=\'../img/cam_08.jpg\' height=\'348px\' width=\'760px\' />';
			ajaxGetRand('cam_superior.html',myTmpHandler,'container-center');
			break;
			
		case 'id=4':
			my$('subheader2').innerHTML='<img src=\'../img/cam_09.jpg\' height=\'348px\' width=\'760px\' />';
			ajaxGetRand('cam_studio.html',myTmpHandler,'container-center');
			break;
			
		case 'id=5':
			my$('subheader2').innerHTML='<img src=\'../img/panorama.jpg\' height=\'348px\' width=\'760px\' />';
			ajaxGetRand('voi_pac.html',myTmpHandler,'container-center');
			break;
			
		case 'id=6':
			my$('subheader2').innerHTML='<img src=\'../img/eve_02.jpg\' height=\'348px\' width=\'760px\' />';
			ajaxGetRand('eve_mat.html',myTmpHandler,'container-center');
			break;
			
		default:
			tmpID = "";
	}
}
