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 calPoints(req)
{
	objs = document.getElementById("pointCal").elements;
	total=0;
	for(ctr=0;ctr<objs.length;ctr++)
	{
		if(objs[ctr].checked && isNumeric(objs[ctr].value))
		total+=parseInt(objs[ctr].value);
	}
	if(req)
	{
		if(req>total)
		alert("Sorry you did not earn the required points;\n Required Points: "+req+"\n You earn: "+total);
		else
		alert("Congratulations your are eligible for applying;\n Required Points: "+req+"\n You earn: "+total);
		
	}
	else
	alert("Your total earning Points are:" + total);
	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;
   
}