function copyMe(obj)
{
	//obj.select();
	//txt = obj.value;
	//window.clipboardData.setData(obj.value);
	//.execCommand("Copy")
	obj.focus()
	obj.select()
	therange=obj.createTextRange()
	therange.execCommand("Copy")
		
	//txt.value.execCommand("Copy");
}
function HighlightAll(theField)
{
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()

	if (document.all&&copytoclip==1){

		therange=tempval.createTextRange()
		therange.execCommand("Copy")
		window.status="Contents copied to your clipboard, now go to your messenger chat window and press CONTROL+V"
		setTimeout("window.status=''",1800)

	}

}
function contactUs(path)
{
	contact  = window.open(path+"contact_us.php","temp2","width=600,height=350,scrollbars=yes");
	contact.focus();
}

var searchDone=false;
function searchIt(path)
{
	//if(searchDone) return false;
	//searchDone=true;
	//alert(path);
	var formObj = document.searchForm	;
	if(formObj.searchOptions.value=="quote")
	{
		formObj.action=(path+"search/quotations/"+formObj.query.value+".htm");
	}else
	if(formObj.searchOptions.value=="author")
	{
		formObj.action=(path+"search/authors/"+formObj.query.value+".htm");
	}else
	if(formObj.searchOptions.value=="article")
	{
		formObj.action=(path+"articles/index.php?q="+formObj.query.value);
	}else
	if(formObj.searchOptions.value=="wallpaper")
	{
		formObj.action=(path+"search/wallpapers/"+formObj.query.value+".htm");
	}else
	if(formObj.searchOptions.value=="screensaver")
	{
		formObj.action=(path+"search/screensavers/"+formObj.query.value+".htm");
	}else
	if(formObj.searchOptions.value=="subject")
	{
		formObj.action=(path+"search/subjects/"+formObj.query.value+".htm");
	}
	document.location.replace(formObj.action);
	return false;
	//formObj.submit();
}

function contactUs(path)
{
	contact  = window.open(path+"contact_us.php","temp2","width=600,height=350,scrollbars=yes");
	contact.focus();
}

function addBookmark(title,url) 
{
	if (window.sidebar) 
	{
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) 
	{
		window.external.AddFavorite( url, title);
	} 
	else if( window.opera && window.print ) 
	{
		return true;
	}
}
function openWindow(pge,widthh,heightt)
{
	opnWin = window.open(pge,'newOpenWindow','status=no,height='+heightt+',width='+widthh+',scrollbars=yes,resizable=yes');
	opnWin.focus();
}
function openWin(pge)
{
	openWindow(pge,650,400);
}

function tellYourFriend()
{
	//alert("ss");
	var  newDoc= document.getElementById("tellYourFriend");
	alert(newDoc.type)
	newDoc.document.getElementById("senderName").value="ss";
	
}
function showScore()
{
	//frm = (document.getElementById("testForm"));
	objs = document.getElementById("testForm").elements;
	total=0;
	for(ctr=0;ctr<objs.length;ctr++)
	{
		if(objs[ctr].checked && isNumeric(objs[ctr].value))
		total+=parseInt(objs[ctr].value);
	}
	document.getElementById("finalScore").value=total;
	document.getElementById("scoreChart").style.visibility= "visible";
	return false;
}
function isNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}
