var siteprefistitle = ".:: welcome to SarbjitShahkoti ";
var pagetitle = new Array();
pagetitle['home']=" Home";
pagetitle['Profile']="Our Profile";
pagetitle['Contact_Us']="Contact us";
pagetitle['Services']="Services";
pagetitle['Gallery']="Gallery";
pagetitle['Videos']="Videos";

function initAll(p){
		ajaxLoader(p,'contents');
		
	} 

	function ajaxLoader(url,id) {
		if (document.getElementById) {
			var ajaxpage = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
		}
		if (ajaxpage) {
			ajaxpage.onreadystatechange = function() {
				if (ajaxpage.readyState == 4 && ajaxpage.status == 200) {
					var el = document.getElementById(id);
					if(el!=null)
					{
					el.innerHTML = ajaxpage.responseText;
					}
					document.title= siteprefistitle+" - "+pagetitle[url];
					
				}else
				{
					var el = document.getElementById(id);
					if(el!=null)
					{
					el.innerHTML = "<div class='mainclink_' style='text-align:center;'><br><br>Please wait while we are loading...<br><br></div>";	
					}
				}
			}
			ajaxpage.open("GET", 'page.php?random='+new Date().getTime()+'&dynamicPage='+url, true);
			ajaxpage.send(null);
		}
	}

function getRealLeft(el){
xPos = document.getElementById(el).offsetLeft;
tempEl = document.getElementById(el).offsetParent;
	while (tempEl != null) {
	xPos += tempEl.offsetLeft;
	tempEl = tempEl.offsetParent;
	}
return xPos;
}
	
function hidepop()
{
document.getElementById("popup").style.display="none";	
}

function writepop(im,nm,dt)
{
var thix = getRealLeft("home");
document.getElementById("popup").style.display="block";	
document.getElementById("img").innerHTML = "<img src='thumb.php?src="+im+"&x=850&y=450&f=0&imf=product_images'>";
document.getElementById("detail").innerHTML ="<h2>"+nm+"</h2>";
document.getElementById("detail").innerHTML +=dt;
//alert(thix);
document.getElementById("popup").style.top = 5+"px";
document.getElementById("popup").style.left = thix+15+"px";

}
//document.onload = initAll(intpage);

