function get_relative_path(str_url)
{
//	alert("url= " + str_url);

	loc=str_url+"";
	i=loc.indexOf("?")
	if(i != -1) 
	{
		ck=loc.substring(0,i+1);
	}
	else
	{
		ck=str_url;
	}

	if(ck.indexOf("http://") != -1) 
	{
		ck = ck.replace('http://','');
	}

//	alert ("ck = " + ck);

	pArray=ck.split("/");
	//alert("length  = " + pArray.length);

	if ( pArray.length > 0)
	{
		rpath="";
		for(r=0;r < (pArray.length-1); r++)
		{
			rpath= rpath + "../";
		}

	}
	else
	{
		rpath="./";
	}

	return rpath;
}
//trial_folder="123baisakhi/www/";	 //comment this while uploading the file on server and vice-versa
trial_folder="";		//uncomment this while uploading the file on server and vice-versa

loc=document.location+"";
rootpath = get_relative_path(loc) + trial_folder;
function viewcart()
{
	window.document.location.href=rootpath+"cart/viewcart.php";
}
var productsDescription = new Array(new Array("TABLA-BOX","Tabla-Box"),new Array("SOAN-PAPDI-HALDIRAM-SWEET","Soan-Papdi-Haldiram-Sweet"),new Array("RASGULLA-HALDIRAM-SWEET","Rasgulla-Haldiram-Sweet"),new Array("DRY-FRUIT-BOX-GREEN-FILLED-WITH-400-GMS-BADAAM-200-GMS-KAJU-AND-200-GMS-KISHMISH","Dry-Fruit-Box-Green-filled-with-400-gms-Badaam-200-gms-Kaju-and-200-gms-Kishmish"),new Array("DRY-FRUIT-BOX-GREEN-FILLED-WITH-400-GMS-BADAAM","Dry-Fruit-Box-Green-filled-with-400-gms-Badaam"),new Array("DRY-FRUIT-BOX-GREEN-FILLED-WITH-400-GMS-KAJU","Dry-Fruit-Box-Green-filled-with-400-gms-Kaju"),new Array("PURE-MAGIC-ASSORTED-COOKIES","Pure-Magic-Assorted-Cookies"),new Array("HALDIRAM-KESAR-GANDERI","Haldiram-Kesar-Ganderi"),new Array("CERAMIC-BHANDANWAAR-RED-COLORED","Ceramic-Bhandanwaar-Red-Colored"),new Array("SQUARE-WOODEN-COASTERS-WITH-GEM-STONE-PAINTING-AND-HOLDER","Square-Wooden-Coasters-With-Gem-Stone-Painting-and-Holder"),new Array("MARBLE-ELEPHANT-SET-SMALL","Marble-Elephant-set-small"),new Array("HANDMADE-PAPER-LAMP-SHADE","Handmade-Paper-Lamp-Shade"),new Array("BLUE-POTTERY-BOTTLE-SHAPE-VASE","Blue-Pottery-Bottle-Shape-Vase"),new Array("KUNDANBELA-SET-DARK-BLUE","Kundanbela-Set-Dark-Blue"),new Array("MEENA-KADA-PINK","Meena-Kada-Pink"),new Array("MEENA-KADA-MAROON","Meena-Kada-Maroon"),new Array("SUIT-WHITE-COLOR","Suit-White-Color"),new Array("SUITE-ORANGE-COLOR","Suite-Orange-Color"),new Array("SUIT-MARRON-COLOR","Suit-Marron-color"),new Array("SHIRT-GREY-COLOR","Shirt-Grey-Color"),new Array("SHIRT-BLUE-COLOR","Shirt-Blue-Color"),new Array("FLOWER-VASE-SET-OF-2","Flower-Vase-set-of-2"),new Array("",""),new Array("",""));
function set_hidden_value(frm, val)
	{
//		alert(frm.name)
//		alert(frm.hidden.value);
		//alert("in set_hiden_value");

		if (val=="add_cart")
		{
			frm.hidden.value="Add to cart";
			//alert(frm.hidden.value);
			//alert("in add_cart");
			//checkMe(frm);
		}
		else if(val=="buy_now")
		{
			frm.hidden.value="Buy Now";
			//alert(frm.hidden.value);		
			//alert("in buy_now");
			//checkMe(frm);
		}
		
	}
function checkMe(frm)
{
	var Flag = false;
	var url=new String();
	var currencyType=new String();
	if (frm.quantity.value <= 0){
		alert("Invalid Quantity!");
		Flag=false;
		return false;	
	}

//alert(frm.hidden.value)


	for (var i=0;i<= frm.currency.length-1 ;i++ ){
		   if (frm.currency[i].checked){
				
				
					if(frm.hidden.value=="Add to cart")
					{
									
						code=frm.pcode.value;
						prod=frm.prodname.value;
						//pcodes=frm.card.value.split("-");
						//alert(frm.prodname.value);
						currencyType = frm.currency[i].value;
						path="&"
						url= getProductDescription(frm.prodname.value)+"/";
						url+= frm.weight.value+"=";
						url+= eval("frm."+currencyType+"rate.value")+"/";
						url+= frm.quantity.value;
						//alert(frm.quantity.value);
						Flag = true;
						
						break;
					}
					else if(frm.hidden.value=="Buy Now")
					{
						code=frm.pcode.value;
						prod=frm.prodname.value;
						//pcodes=frm.card.value.split("-");
						//alert(frm.prodname.value);
						currencyType = frm.currency[i].value;
						path="&backto=viewcart&"
						url= getProductDescription(frm.prodname.value)+"/";
						url+= frm.weight.value+"=";
						url+= eval("frm."+currencyType+"rate.value")+"/";
						url+= frm.quantity.value;
						//alert(frm.quantity.value);
						Flag = true;
						break;
					   }


				
			}
		}
	if (Flag == false){
		alert("Please select the Payment Currency Type and then click on Buy Now button\n to proceed to online transaction.\n\nThank You !");
		return false;	
	}
	//alert(url);
	if (Flag){

		//trial_folder="trial/";
		
//		trial_folder="new-diwalimela.com/";	 
		
//		trial_folder="";	// uncomment when uploading the file.


		old_url=url;

		url=rootpath + "cart/addcart.php?cur_type="+currencyType+path+code+"/"+old_url;
		
		//url="../cart/addcart.php?cur_type="+currencyType+path+code+"/"+url;
	
//		loc=document.location+"";
		
//		alert(get_relative_path(loc));

//		newurl=get_relative_path(loc) + trial_folder + "cart/addcart.php?cur_type="+currencyType+path+code+"/"+old_url;



		newurl=rootpath + "cart/addcart.php?cur_type="+currencyType+path+code+"/"+old_url;

//		alert(newurl);
//		window.document.location.href=url;

		window.document.location.href=newurl;

	}
	return false;
}

  function getProductDescription(_sPcode){
	for ( var i=0; i<productsDescription.length;i++){
			if ( _sPcode.toUpperCase() == productsDescription[i][0].toUpperCase() ){
			
			//alert("matched " + i);
				return productsDescription[i][1];
			}
	}
//return false;
}
/*
function cry(){
window.open("http://www.dgreetings.com/delink.html","win1","menubar=0,location=yes,status=no,directories=no,toolbar=yes,scrollbars=yes,height=400,width=400,resizable=yes,alwaysRaised=no,left=0,top=0"); 
}*/
function pop(){

window.open("http://www.indiamapstore.com","win1","location=yes,status=yes,directories=yes,toolbar=yes,scrollbars=yes,height=400,width=600,resizable=yes,alwaysRaised=yes,left=50,top=0");
}

function top (){
 document.write('<table width=780 cellpadding="0" cellspacing="0" border="0"  align="center" bgcolor=#FFFFFF>	<tr valign=top>		<td valign=top><img src="http://www.123baisakhi.com/images/h1.jpg">		</td><td valign=top><img src="http://www.123baisakhi.com/images/h2.jpg">		</td><td valign=top><img src="http://www.123baisakhi.com/images/h3.jpg">		</td>	</tr></table>');
}
function left (){
 document.write('<table vlign=top align=center>	<tr  valign=top >					<td  valign=top align=left>					<a href="http://www.123baisakhi.com/index.html"><font color="Maroon" size="2" face=verdana>Home</a></a><br>		<br>				 <a href="http://www.123baisakhi.com/baisakhi/festival/index.html"><img src=http://www.123baisakhi.com/images/fastival.gif border=0></a>				<br><br>				 <a href="http://www.123baisakhi.com/baisakhi/customs/index.html"><img src=http://www.123baisakhi.com/images/customs.gif border=0>				</a><br><br>				  <a href="http://www.123baisakhi.com/baisakhi/significance/index.html"><img src=http://www.123baisakhi.com/images/significance.gif border=0></a>				<br><br>				 <a href="http://www.123baisakhi.com/baisakhi/delights/index.html"><img src=http://www.123baisakhi.com/images/delights.gif border=0></a>				<br><br>				 <a href="http://www.123baisakhi.com/baisakhi/cards/index.html"><img src=http://www.123baisakhi.com/images/cards.gif border=0></a>				<br><br>				<a href="http://www.123baisakhi.com/baisakhi/wallpapers/index.html"><img src=http://www.123baisakhi.com/images/wallpapers.gif border=0></a>				<br><br>				 <a href="http://www.123baisakhi.com/baisakhi/celebrations/index.html"><img src=http://www.123baisakhi.com/images/celebrations.gif border=0></a>				</tr></td></table>'); 
}

function bottom(){
document.write('<table ><tr><td >	<img src=http://www.123baisakhi.com/images/bline.jpg>	</td></tr>	</tr></table>')

					}
					
					
					
		function bottom1()
	{

		document.write('<table width="350"><tr><td colspan="4" align="center"><font color="Maroon" size="2"> <b>SEND QUICK  CARDS</b></font></td></tr><tr><td><a href="http://dgreetings.com/baisakhi/baisakhi004.htm" target="_blank"><img src="http://www.123baisakhi.com/images04/cards/baisakhi004t.gif" width="70" height="70" border="0" alt="baisakhi cards"></a></td><td><a href="http://dgreetings.com/baisakhi/baisakhi005.htm" target="_blank"><img src="http://www.123baisakhi.com/images04/cards/baisakhi005t.gif" width="70" height="70" border="0" alt="baisakhi cards"></a></td><td><a href="http://dgreetings.com/baisakhi/baisakhigrand01.htm" target="_blank"><img src="http://www.123baisakhi.com/images04/cards/baisakhigrand01t.jpg" width="70" height="70" border="0" alt="baisakhi cards"></a></td><td><a href="http://dgreetings.com/baisakhi/baisakhi21.htm" target="_blank"><img src="http://www.123baisakhi.com/images04/cards/icon-70-baisaki.gif" width="70" height="70" border="0" alt="baisakhi cards" ></a></td></tr><tr></table>')


}
	
	function footer()
	{
	document.write('<center><TABLE bgcolor="#Ffffff" align="center" width="760" border="3" cellpadding="0" cellspacing="0" bordercolor="green" rules="none"><TR><TD valign="top"><HR color="C04515" width="740"></TD></TR><tr><td colspan="3" align="left"><font color="navy" size="-1"><b>Channels:</b></font>&nbsp;<a href="http://www.mydearvalentine.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Valentine,</b></font></a> <a href="http://www.123janmashtami.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Janmashtami,</b></font></a> <a href="http://www.virtualrakhi.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Rakhi,&nbsp;</b></font></a><a href="http://www.wallpapers.dgreetings.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Wallpapers,</b></font></a> <a href="http://www.diwalimela.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Diwali,</b></font></a>&nbsp;<a href="http://www.123durgapuja.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Durgapooja,</b></font></a> <a href="http://www.theeid.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Eid,</b></font></a> <a href="http://www.malayalifestivals.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Malayali festivals,</b></font></a>&nbsp;<a href="http://www.123baisakhi.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Baisakhi,</b></font></a>&nbsp;<a href="http://www.123pongal.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Pongal,</b></font></a>  <a href="http://www.123christians.com" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Christian Festivals, </b></font></a><a href="Links-index.html" class="left" target="_blank"><font color="#990033" size="-2" face="arial"><b>Other Links</b></font></a></td></tr><TR><TD valign="top"><HR color="C04515" width="740"></TD></TR><TR><TD valign="top" bgcolor="#Ffffff" height="15" align="center" width="745"><A href="http://www.123baisakhi.com/baisakhi/forms/recommend.html"><FONT size="-2" color="C04515" face="VERDANA"><B>|&nbsp;RECOMMEND THIS SITE&nbsp;|</B></FONT></A>&nbsp;<A href="http://www.123baisakhi.com/baisakhi/forms/privacy.htm"><FONT size="-2" color="C04515" face="VERDANA"><B>PRIVACY AGREEMENT&nbsp;|</B></FONT></A>&nbsp;<A href="http://www.123baisakhi.com/baisakhi/forms/feedback.htm"><FONT size="-2" color="C04515" face="VERDANA"><B>FEEDBACK&nbsp;|</B></FONT></A>&nbsp;<A href="http://www.123baisakhi.com/baisakhi/forms/mailing.htm"><FONT size="-2" color="C04515" face="VERDANA"><B>MAILING LIST&nbsp;|</B></FONT></A>&nbsp;<A href="http://www.123baisakhi.com/baisakhi/forms/disclaimer.htm"><FONT size="-2" color="C04515" face="VERDANA"><B>DISCLAIMER&nbsp;|</B></FONT></a>&nbsp;<A href="mailto:webmaster@123baisakhi.com"><FONT size="-2" color="C04515" face="VERDANA"><B>		CONTACT US |</B></FONT></A>		</TD></TR><TR bgcolor="#ffffff"><TD align="center" valign="bottom" width="740">		<TABLE align="center" width="740" border="0" bgcolor="#ffffff"><TR><TD align="center"><FONT size="+1" color="C04515">Member site of </FONT><A href="http://www.dgreetings.com"><FONT size="3" color="#EE8862"><B>Dgreetings.com</B></FONT>&nbsp;<FONT size="+1" color="C04515">Family</FONT></A> </td></TR>		</TABLE></TD></TR><TR><TD valign="top">	<TABLE width="740" border="0" cellspacing="0" cellpadding="0" width="740">	<TR><TD align="center">	<HR color="C04515" width="740"></TD></TR>	<TR valign="top"><TD><TABLE width="743">	<TR><TD><FONT size="-2" face="Arial" color="Black">	Site Designed, Developed & Maintained By<BR><A href="http://www.infobase.co.in/">Compare Infobase (P) Ltd</A><BR>Copyright 2005<br>C-62, Janak Community Center<BR>Janakpuri, New Delhi-58 (India)<br>Tel : +91-11-25542045, 55453565/66, Fax : +91-11-25547264<br>Mobile : +91(0) 9871399003, 9871399000 <BR><A href="mailto:compare@vsnl.com">					compare@vsnl.com</A></FONT><br><FONT SIZE="1" COLOR="#0A1567">We host with</font><A HREF="http://www.serversindia.net" target="_blank"><FONT COLOR="#0000f0" face="arial" size="1"> Serversindia.net Pvt. Ltd. </FONT></a></TD>		<TD align="right"><a href="http://www.infobase.co.in" target="_blank"><IMG src="http://www.123baisakhi.com/baisakhi/homegif/comparelogo.gif" width="44" height="76" border="0" alt="Compare Infobase"></a></TD></TR></TABLE></TD></TR></TABLE>');
	
	}	