var ajax = new GLM.AJAX();

function setHome()
{
   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage(window.location.href);
}

function loadPage(link){
	location.href=link;
}
function changePic(img,obj){
	obj.src	=	img;
}
function changeClass(cname,name){
	
	document.getElementById(name).className=cname;
}

function showDv(surl,dv){
	//alert(surl);
	//alert(dv);
	ajax.callPage(surl,dv);
}
function search(div1,path,color){
	var out;
	
	out	=	'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="300" height="30" id="group" align="middle">';
	out	=	out+ '<param name="allowScriptAccess" value="sameDomain" />';
	out	=	out+ '<param name="allowFullScreen" value="false" />';
	out	=	out+ '<param name="movie" value="'+path+'images/reading.swf" />';
	out	=	out+ '<param name="quality" value="high" />';
	out	=	out+ '<param name="bgcolor" value="#'+color+'" />';	
	out	=	out+ '<embed src="'+path+'images/reading.swf" quality="high" bgcolor="#'+color+'" width="300" height="30" name="group" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	out	=	out+ '</object>';
	document.getElementById(div1).innerHTML	=	out;
}
function showNill(dv){	
	document.getElementById(dv).innerHTML	=	'';
}
function saveBlog(link){
	var title;
	var des;
	var mess='';
	title	=	blogTForm.TITLE.value;
	des	=	blogTForm.DES.value;

	if (title=='')
	{
		mess	=	'Title\n';	
	}
	else{
		link	=	link	+ '&TITLE='+title;
	}
	if (des=='')
	{
		mess	=	mess+'Body\n';	
	}
	else{
		link	=	link	+ '&DES='+des;
	}
	if (mess=='')
	{
		showNill('tbody');
		showDv(link,showIbody);
	}
	else {
		alert('Please correct following field(s)\n'+mess);
	}

}

function Maximize() 
{
	window.innerWidth = screen.width;
	window.innerHeight = screen.height;
	window.screenX = 0;
	window.screenY = 0;
	alwaysLowered = false;
	alert(screen.width);
	
}

function openWindow(strURL,name){
	var strFeatures;
	strFeatures = "top=0px,left=0px,width="+screen.width+"px,height="+screen.height+"px,menubar=no, directories=no, scrollbars=yes,status=yes, resizable=yes";
	window.open (strURL, name, strFeatures)

}

function openPicture(link){
	window.open(link,'photos','left=0,top=0,width=700,height=600,location=0,toolbar=0,resizable=0');
	//showDv(link,showBody);
}



function showMenu(response){	
	document.getElementById('menu').innerHTML	=	response;
}
function showLMenu(response){	
	document.getElementById('lmenu').innerHTML	=	response;
}
function showBody(response){
	//alert(response);
	document.getElementById('body').innerHTML	=	response;
}
function showTbody(response){	
	document.getElementById('tbody').innerHTML	=	response;
}
function showIbody(response){
	document.getElementById('ibody').innerHTML	=	response;
}
function showBlog(response){	
	document.getElementById('blog').innerHTML	=	response;
}
function showMainTitle(response){	
	document.getElementById('mainTitle').innerHTML	=	response;
}
function showReply(response){	
	document.getElementById('reply').innerHTML	=	response;
}
function showPictures(response){	
	document.getElementById('pictures').innerHTML	=	response;
}
function showAdd(response){	
	document.getElementById('add').innerHTML	=	response;
}

function showFladv(response){	
	document.getElementById('fladv').innerHTML	=	response;
}
function showFlaBox(response){	
	document.getElementById('flaBox').innerHTML	=	response;
}
function showDes(response){	
	document.getElementById('des').innerHTML	=	response;
}
function showList(response){	
	document.getElementById('list').innerHTML	=	response;
}
function showEdit(response){	
	document.getElementById('edit').innerHTML	=	response;
}

function showLink(code,link,cls,name){
	changeClass(cls,name)
	showDv(link,showBody);
		
}

function downloadFile(dlink,obj){
	//document.getElementById('reply').innerHTML	=	"Creating a file ...";
	dlink	=	dlink+document.sfFrm.FTYPE.value;
	location.href	=	dlink;
}







