//#---------------------------------------------------------------------#
//#	DESCRIPTION		:	basic.js										#
//#	AUTHOR			:	Kithsir Lihinikaduwa							#
//# CREATE DATE		:	JAN 26, 2008									#
//#	LAST CHANGED	:	JAN 26, 2008									#
//#---------------------------------------------------------------------#

var ajax = new GLM.AJAX();

function showDv(surl,dv){
	//alert(surl);
	//alert(dv);
	ajax.callPage(surl,dv);
}

function ChangeMPic(obj,path,img){
	obj.src	=	path+"images/psm/"+img;
}
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 eBBsearch(cde){
	var eBBVal;
	var url;
	eBBVal	=	document.getElementById('eBBSearch').value;
	url		=	"http://www.ebingbong.com/searchui/basic.php";
	switch (cde)
	{
		case 0:
			url	=	"http://www.ebingbong.com/searchui/showResults.php?lg=0&enc=utf-8&rank=1&age=0&cclic=0&ftype=&safe=3&display=1%3A10&cat=&ftype=&box="+eBBVal+"&where=0&q=%2B"+eBBVal+"&styp=0&domain=&bi=";
		break;
		case 1:
			url	=	"http://www.ebingbong.com/searchui/image/showResults.php?lg=0&enc=utf-8&rank=1&age=0&cclic=0&where=0&ftype=&safe=3&display=1%3A12&box="+eBBVal+"&q=%2B"+eBBVal+"&styp=0&domain=";
		break;
		case 2:
			url	=	"http://www.ebingbong.com/searchui/vrecommends/showResults.php?lg=0&enc=utf-8&safe=3&age=0&where=0&cclic=0&ftype=&rank=1&display=1%3A10&box="+eBBVal+"&duration=all&q=%2B"+eBBVal+"&styp=0&domain=";
		break;
		case 3:
			url	=	"http://www.ebingbong.com/searchui/nrecommends/showResults.php?lg=0&enc=utf-8&safe=3&age=0&where=0&cclic=0&ftype=&rank=1&display=1%3A10&box="+eBBVal+"&q=%2B"+eBBVal+"&styp=0&domain=";
		break;
		
	
	}
	document.location.href	=	url;
}



function textCounter(field,cntfield,maxlimit) {
	if (field.value.length > maxlimit){
		field.value = field.value.substring(0, maxlimit);
	}
	else{
		cntfield.value = maxlimit - field.value.length;
	}
}








function showMenu(response){	
	document.getElementById('menu').innerHTML	=	response;
}
function showBrows(response){
	document.getElementById('brows').innerHTML	=	response;
}
function showFriends(response){
	document.getElementById('friends').innerHTML	=	response;
}
function showDetails(response){
	document.getElementById('details').innerHTML	=	response;
}
function showContact(response){
	document.getElementById('contact').innerHTML	=	response;
}
function showPicture(response){
	document.getElementById('picture').innerHTML	=	response;
}
function showPic(response){
	document.getElementById('pic').innerHTML	=	response;
}
function showComment(response){
	document.getElementById('comment').innerHTML	=	response;
}
function showMess(response){

	document.getElementById('mess').innerHTML	=	response;
}
function showBody(response){
	document.getElementById('body').innerHTML	=	response;
}
function showTitle(response){
	document.getElementById('title').innerHTML	=	response;
}
function showAbout(response){
	document.getElementById('about').innerHTML	=	response;
}
function showInfo(response){
	document.getElementById('info').innerHTML	=	response;
}
function showExcl(response){
	document.getElementById('excl').innerHTML	=	response;
}
function showArtist(response){
	document.getElementById('artist').innerHTML	=	response;
}
function showRate(response){
	document.getElementById('rate').innerHTML	=	response;
}
function showRmusic(response){
	document.getElementById('rmusic').innerHTML	=	response;
}
function showMusic(response){
	document.getElementById('music').innerHTML	=	response;
}
function showPList(response){
	document.getElementById('plist').innerHTML	=	response;
}


function getSWidth(){
	var swidth;
	swidth	=	screen.width;
	if (swidth<780)
	{
		swidth	=	770;
	}
	else if (swidth>1600){
		swidth	= 1200;
	}
	else{
		swidth	= swidth-40;
	}
	document.getElementById('mtbody').style.width 	=	swidth+"px";

}

