﻿// JScript File
function opinions(typ)
	{
	 if (typ=="yahoo")
	    {
	    mytarget="http://myweb2.search.yahoo.com/myresults/bookmarklet?t="+encodeURIComponent(document.title)+"&u="+encodeURIComponent(document.location.href)+" ";
	    window.open(mytarget);
	    }
	 if (typ=="fark")
	    {
	    mytarget="http://cgi.fark.com/cgi/fark/edit.pl?new_url="+encodeURIComponent(document.location.href)+"&new_comment="+encodeURIComponent(document.title)+"&new_link_other=&linktype=Misc";
	    window.open(mytarget);

	    }
	 if (typ=="digg")
	    {
	    mytarget="http://digg.com/submit?phase=2&url="+encodeURIComponent(document.location.href)+" ";
	    window.open(mytarget);

	    }
	 if (typ=="reditt")
	    {
	    mytarget="http://reddit.com/submit?url="+encodeURIComponent(document.location.href)+"&title="+encodeURIComponent(document.title)+" ";
	    window.open(mytarget);
	    
	    }
	 if (typ=="del")
	    {
	    mytarget="http://del.icio.us/post?v=2&url="+encodeURIComponent(document.location.href)+"&title="+encodeURIComponent(document.title)+" ";
	    window.open(mytarget);

	    }
	 if (typ=="newsvine")
	    {
	    mytarget="http://www.newsvine.com/_tools/seed&save?u="+encodeURIComponent(document.location.href)+"&h="+encodeURIComponent(document.title)+" ";
	    window.open(mytarget);

	    }
	 }
	 function EmailMe(titlefor)
	 {
	    mytarget = "http://www.spicezee.com/sendemail.aspx?urlfor="+encodeURIComponent(document.location.href)+"&whois=story&stitle="+titlefor;
	    window.open(mytarget, 'email', 'width=455,height=305,scrollBars=no,statusbar=no');
	 }
	 
	 function EmailMeGallery(titlefor, pid, imgid)
	 {
	    mytarget = "http://www.spicezee.com/sendemail.aspx?urlfor="+encodeURIComponent("http://www.spicezee.com/photogallery/"+pid+"/image"+imgid+".htm")+"&whois=image&stitle="+titlefor;
	    window.open(mytarget, 'email', 'width=455,height=305,scrollBars=no,statusbar=no');
	 }
	 
	 function EmailMeVideo(titlefor, videoid)
	 {
	    mytarget = "http://www.spicezee.com/sendemail.aspx?urlfor="+encodeURIComponent("http://www.spicezee.com/video/"+videoid+"/video.htm")+"&whois=video&stitle="+titlefor;
	    window.open(mytarget, 'email', 'width=455,height=305,scrollBars=no,statusbar=no');
	 }
	 function ValideTxt(objVal)
	 {
	    var val = objVal;
	    if(val!='')
	    {
            	  val = val.replace("'", "`");
            	  val = val.replace("\"","``");
	    }
	    return objVal;
	 }
function urmsg(cid)
{
	//
	window.open ("msg_window.asp?cid="+cid,'comment','height=0,width=0,scrollbars=no,statusbar=no,top=0,left=0');
	alert("Thanks for the alert..");

}
//created on: 12th May 2002
//Programmer: Prashant Sharma
//Purpose	: This function is used to validate email. 
//Arguments : Email object
function ValidateEMail(objName)
{
	var sobjValue;
	var iobjLength;
	var counterE=0;
	
	sobjValue=objName.value;
	iobjLength=sobjValue.length;
	iFposition=sobjValue.indexOf("@");
	iSposition=sobjValue.indexOf(".");
	iTmp=sobjValue.lastIndexOf(".");	
	iPosition=sobjValue.indexOf(",");
	iPos=sobjValue.indexOf(";");	
	if (iobjLength!=0)
	{
		if ((iFposition == -1)||(iSposition == -1))
		{
			counterE = 1;
		}
		else if(sobjValue.charAt(0) == "@" || sobjValue.charAt(0)==".")
		{
			counterE = 1;
		}
		/*else if(sobjValue.charAt(iobjLength) == "@" ||
			sobjValue.charAt(iobjLength)==".")
		{
			counterE = 1;				
		}	
		else if((sobjValue.indexOf("@",(iFposition+1)))!=-1)
		{	
			counterE = 1;
		}
		else if ((iobjLength-(iTmp+1)<2)||(iobjLength-(iTmp+1)>3))
		{
			counterE = 1;
		}
		else if ((iPosition!=-1) || (iPos!=-1))
		{
			counterE = 1;			
		}*/
		else
		{
			return true;
		}				
	}	
	else
	{
	    return false;
	}	
	if (counterE == 1)
	{
	    alert("Email id is wrong");	 
	    objName.focus();
		return false;
	}	
	return true;	
}


//created on: 12th May 2002
//Programmer: Prashant Sharma
//Purpose	: This function is used to validate email. 
//Arguments : Email object
function ValidateEMailMe(objName)
{
	var sobjValue;
	var iobjLength;
	var counterE=0;
	
	sobjValue=objName.value;
	iobjLength=sobjValue.length;
	iFposition=sobjValue.indexOf("@");
	iSposition=sobjValue.indexOf(".");
	iTmp=sobjValue.lastIndexOf(".");	
	iPosition=sobjValue.indexOf(",");
	iPos=sobjValue.indexOf(";");	
	if (iobjLength!=0)
	{
		if ((iFposition == -1)||(iSposition == -1))
		{
			counterE = 1;
		}
		else if(sobjValue.charAt(0) == "@" || sobjValue.charAt(0)==".")
		{
			counterE = 1;
		}
		else if(sobjValue.charAt(iobjLength) == "@" ||
			sobjValue.charAt(iobjLength)==".")
		{
			counterE = 1;				
		}	
		else if((sobjValue.indexOf("@",(iFposition+1)))!=-1)
		{	
			counterE = 1;
		}
		else if ((iobjLength-(iTmp+1)<2)||(iobjLength-(iTmp+1)>3))
		{
			counterE = 1;
		}
		else if ((iPosition!=-1) || (iPos!=-1))
		{
			counterE = 1;			
		}
		else
		{
			return true;
		}				
	}	
	else
	{
	    return false;
	}	
	if (counterE == 1)
	{
	    alert("Email id is wrong");	 
	    objName.focus();
		return false;
	}
	return false;		
}