<!--
var oldht;
var window_now;

MyImages=new Array(); 

MyImages[0]='images/best_jewellers_india_01.jpg'
MyImages[1]='images/best_jewellers_india_02.jpg'
MyImages[2]='images/best_jewellers_india_03.jpg'
MyImages[3]='images/best_jewellers_india_04.jpg'
MyImages[4]='images/best_jewellers_india_05.jpg'
MyImages[5]='images/best_jewellers_india_06.jpg'
MyImages[6]='images/best_jewellers_india_07.jpg'

imagesPreloaded = new Array(7) 
for (var i = 0; i < MyImages.length ; i++) 
{
imagesPreloaded[i] = new Image()
imagesPreloaded[i].src=MyImages[i]
}

function click() { if (event.button==2) alert("Welcome to Best Jewellers India !"); }

document.onmousedown = click;

function InitState(thisValue)
{
	var str=thisValue;
	var strSel='';
	var arrDistrict;

	ClearList(document.frmBSI.ddlDistrict);

	if (str.indexOf('_')>0)
	{	
		document.frmBSI.hidState.value=str.split('_')[0].split('*')[0];

		arrDistrict = str.split('_')[1].split('|');
		
		for (i=0; i<arrDistrict.length; i++)
		{

			if (document.frmBSI.hidDistrict.value==arrDistrict[i].split('*')[0])
			{
				strSel=arrDistrict[i].split('*')[0];
				SetOption(document.frmBSI.ddlDistrict, i, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], true, true);
			}
			else
			{
				SetOption(document.frmBSI.ddlDistrict, i, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], false, false);
			}

		}
		SelectDistrict(strSel);		
	}
	else
	{
		document.frmBSI.hidState.value=str.split('*')[0];
	}
}

function SelectState(thisValue)
{
	var str=thisValue;
	var strSel='';
	var arrDistrict;

	ClearList(document.frmBSI.ddlDistrict);
	document.frmBSI.ddlDistrict.disabled=false;

	if (thisValue=="")
	{
		document.frmBSI.ddlDistrict.disabled=true;
		document.frmBSI.hidState.value="";
		document.frmBSI.hidDistrict.value="";	
	}
	else
	{
		if (str.indexOf('_')>0)
		{	
			document.frmBSI.hidState.value=str.split('_')[0].split('*')[0];

			arrDistrict = str.split('_')[1].split('|');

			if (str.split('_')[0].split('*')[3]=='N')
			{ 
				SetOption(document.frmBSI.ddlDistrict, 0, "All Districts", "", true, true);

				for (i=0; i<arrDistrict.length; i++)
				{
 					if (document.frmBSI.hidDistrict.value==arrDistrict[i].split('*')[0])
					{
						SetOption(document.frmBSI.ddlDistrict, i+1, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], true, true);
						strSel=arrDistrict[i].split('*')[0];
					}
					else
					{
						SetOption(document.frmBSI.ddlDistrict, i+1, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], false, false);
					}
				}
			}
			else if (str.split('_')[0].split('*')[3]=='Y')
			{
				SetOption(document.frmBSI.ddlDistrict, 0, arrDistrict[0].split('*')[1], arrDistrict[0].split('*')[0], true, true);
				strSel=arrDistrict[0].split('*')[0];

			}
			else
			{

				for (i=0; i<arrDistrict.length; i++)
				{
 					if (arrDistrict[i].split('*')[2]=='Y')
					{
						SetOption(document.frmBSI.ddlDistrict, i, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], true, true);
						strSel=arrDistrict[i].split('*')[0];
					}
					else
					{
						SetOption(document.frmBSI.ddlDistrict, i, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], false, false);
					}
				}
			}

			SelectDistrict(strSel);
		}
		else
		{
			document.frmBSI.hidState.value=str.split('*')[0];
		}
	}
}

function SelectDistrict(thisValue)
{
	document.frmBSI.hidDistrict.value=thisValue;
}

function SelectOffState(thisValue)
{
	var str=thisValue;
	var strSel='0';
	var arrDistrict;

	ClearList(document.frmBSI.ddlOffDistrict);

	if (str.indexOf('_')>0)
	{	
		document.frmBSI.hidOffState.value=str.split('_')[0].split('*')[0];

		arrDistrict = str.split('_')[1].split('|');

		for (i=0; i<arrDistrict.length; i++)
		{
			if (arrDistrict[i].split('*')[2]=="Y")
			{
				SetOption(document.frmBSI.ddlOffDistrict, i, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], true, true);	
				strSel=arrDistrict[i].split('*')[0];
			}
			else
			{
				SetOption(document.frmBSI.ddlOffDistrict, i, arrDistrict[i].split('*')[1], arrDistrict[i].split('*')[0], false, false);
			}
		}
	}
	else
	{
		document.frmBSI.hidOffState.value=str.split('*')[0];
	}
	SelectOffDistrict(strSel);
}

function SelectOffDistrict(thisValue)
{
	document.frmBSI.hidOffDistrict.value=thisValue;
}

function SelectLevel(thisValue)
{
	document.frmBSI.hidLevel.value=thisValue;
}

function SelectService(thisIndex)
{
	if (document.frmBSI.ddlService.options[thisIndex].value=="0")
	{
		document.frmBSI.ddlService.selectedIndex=document.frmBSI.ddlService.selectedIndex+1;
		thisIndex=document.frmBSI.ddlService.selectedIndex;
	}

	if (eval(document.frmBSI.ddlService.options[thisIndex].value)<10000 || document.frmBSI.ddlService.options[thisIndex].value=="")
	{
		if (eval(document.frmBSI.hidService.value)>=10000)
		{ 	
			SelLevel();
		}	
	}
	else
	{
		if (eval(document.frmBSI.hidService.value)<10000 || document.frmBSI.hidService.value=="")
		{		
			SetPropertyType();
		}
	}
	document.frmBSI.hidService.value=document.frmBSI.ddlService.options[thisIndex].value;
}

function SetPropertyType()
{
	ClearList(document.frmBSI.ddlLevel);
	
	SetOption(document.frmBSI.ddlLevel, 0, "All Properties", "", true, true);

	SetOption(document.frmBSI.ddlLevel, 1, "Agricultural Land", "2", false, false);
	SetOption(document.frmBSI.ddlLevel, 2, "Commercial Complex", "5", false, false);
	SetOption(document.frmBSI.ddlLevel, 3, "Commercial Office Space", "6", false, false);
	SetOption(document.frmBSI.ddlLevel, 4, "Commercial Shop", "7", false, false);
	SetOption(document.frmBSI.ddlLevel, 5, "Godown / Warehouse", "12", false, false);
	SetOption(document.frmBSI.ddlLevel, 6, "Commercial Land", "17", false, false);
	SetOption(document.frmBSI.ddlLevel, 7, "Residential Apartment", "19", false, false);
	SetOption(document.frmBSI.ddlLevel, 8, "Residential Bungalow", "20", false, false);
	SetOption(document.frmBSI.ddlLevel, 9, "Residential House", "21", false, false);
	SetOption(document.frmBSI.ddlLevel, 10, "Residential Land", "22", false, false);
	SetOption(document.frmBSI.ddlLevel, 11, "Others", "27", false, false);

	document.frmBSI.hidLevel.value="";
}

function SelLevel()
{
	ClearList(document.frmBSI.ddlLevel);

	SetOption(document.frmBSI.ddlLevel, 0, "All Levels", "", true, true);

	SetOption(document.frmBSI.ddlLevel, 1, "All India Level", "1", false, false);
	SetOption(document.frmBSI.ddlLevel, 2, "State Level", "2", false, false);
	SetOption(document.frmBSI.ddlLevel, 3, "District / City Level", "3", false, false);

	document.frmBSI.hidLevel.value="";
}

function ClearList(thisList)
{
    var IsClear=false;

    while (!IsClear) 
    {
       for(i=0; i<thisList.options.length; i++) thisList.options[i]=null;
       if(thisList.options.length==0) IsClear=true;
    }	
}

function SetOption(thisCtrl, OptionIndex, OptionText, OptionValue, optDef, optSel)
{
   var thisOption = new Option(OptionText, OptionValue, optDef, optSel);
   if (OptionValue=="") thisOption.style.color="#0567D3";		
   thisCtrl.options[OptionIndex]=thisOption;
}

function GetDateStr(thisDate)
{
	var dt = new Date(thisDate);
	var str;
	
	str = dt.getDate()+' '+GetMonthName(dt.getMonth()+1)+' '+((dt.getYear()<2000) ? 1900+dt.getYear() : dt.getYear());

	return str;
}

function GetMonthName(thisMonthNum)
{
	var arrMon = new Array();
	arrMon[1]='JAN';
	arrMon[2]='FEB';
	arrMon[3]='MAR';
	arrMon[4]='APR';
	arrMon[5]='MAY';
	arrMon[6]='JUN';
	arrMon[7]='JUL';
	arrMon[8]='AUG';
	arrMon[9]='SEP';
	arrMon[10]='OCT';
	arrMon[11]='NOV';
	arrMon[12]='DEC';
	return arrMon[thisMonthNum];
}

function findPosition( oLink ) 
{
  if( oLink.offsetParent ) {
    for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) {
      posX += oLink.offsetLeft;
      posY += oLink.offsetTop;
    }
       return [posY];
  } else {
       return [oLink.y];
  }
}

var DHTML=(document.getElementById || document.all || document.layers);

function getObj(name)
{
	if (document.getElementByID)
	{
		this.obj=document.getElementById(name);
		this.style=document.getElementById(name).style;
	}
	else if (document.all)
	{
		this.obj=document.all[name];
		this.style=document.all[name].style;
	}
	else if (document.layers)
	{
		this.obj=document.layers[name];
		this.style=document.layers[name];
	}
}

function changetablesize(ml,mm,mr)
{
	var x=new getObj(mm); 
	var l=new getObj(ml); 
	var r=new getObj(mr); 

 	var myWidth = 0, myHeight = 0;
  	
	if( typeof( window.innerWidth ) == 'number' ) 
	{
    	//Non-IE
    	myWidth = window.innerWidth-16;
    	myHeight = window.innerHeight;
  	} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{
    	//IE 6+ in 'standards compliant mode'
    	myWidth = document.documentElement.clientWidth;
    	myHeight = document.documentElement.clientHeight;
  	} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
	{
    	//IE 4 compatible
    	myWidth = document.body.clientWidth;
    	myHeight = document.body.clientHeight;
  	}

	if(document.layers)
	{
		document.x.width=myWidth-320;
		document.x.height=0
		document.r.height=0
		document.l.height=0

		document.x.height=findPosition(document.fmidpos.midpos)-95;
	    document.r.height=findPosition(document.footer.fot)-95;
		document.l.height=findPosition(document.frmBSI.lpos)-95;

		if (eval(document.r.height.split('px')[0])>eval(document.x.height.split('px')[0]))
		{
			if (eval(document.r.height.split('px')[0])>eval(document.l.height.split('px')[0]))
			{
				document.x.height=document.r.height;
				document.l.height=document.r.height;
			}
			else
			{
				document.x.height=document.l.height;
				document.r.height=document.l.height;
			}
		}
		else
		{
			if (eval(document.x.height.split('px')[0])>eval(document.l.height.split('px')[0]))
			{
				document.l.height=document.x.height;
				document.r.height=document.x.height;
			}
			else
			{
				document.x.height=document.l.height;
				document.r.height=document.l.height;
			}
	    }
	}

	if(document.all)
	{
		x.style.width=myWidth-320;
		x.style.height=0
		r.style.height=0
		l.style.height=0

		x.style.height=findPosition(document.fmidpos.midpos)-95;
		r.style.height=findPosition(document.footer.fot)-95;
		l.style.height=findPosition(document.frmBSI.lpos)-95;

		if (eval(r.style.height.split('px')[0])>eval(x.style.height.split('px')[0]))
		{

			if (eval(r.style.height.split('px')[0])>eval(l.style.height.split('px')[0]))
			{
				x.style.height=r.style.height;
				l.style.height=r.style.height;
			}
			else
			{
				x.style.height=l.style.height;
				r.style.height=l.style.height;
			}
		}
		else
		{
			if (eval(x.style.height.split('px')[0])>eval(l.style.height.split('px')[0]))
			{
				l.style.height=x.style.height;
				r.style.height=x.style.height;
			}
			else
			{
				x.style.height=l.style.height;
				r.style.height=l.style.height;
			}
		}

	}

	if(!document.all && document.getElementById)
	{
		document.getElementById(mm).style.width=myWidth-320;
		document.getElementById(mm).style.height=0
		document.getElementById(mr).style.height=0
		document.getElementById(ml).style.height=0

		document.getElementById(mm).style.height=findPosition(document.fmidpos.midpos)-95;
		document.getElementById(mr).style.height=findPosition(document.footer.fot)-95;
		document.getElementById(ml).style.height=findPosition(document.frmBSI.lpos)-95;

		if (eval(document.getElementById(mr).style.height.split('px')[0])>eval(document.getElementById(mm).style.height.split('px')[0]))
		{
			if (eval(document.getElementById(mr).style.height.split('px')[0])>eval(document.getElementById(ml).style.height.split('px')[0]))
			{
  	    		document.getElementById(mm).style.height=document.getElementById(mr).style.height;
  	    		document.getElementById(ml).style.height=document.getElementById(mr).style.height;
			}
			else
			{
  	    		document.getElementById(mm).style.height=document.getElementById(ml).style.height;
  	    		document.getElementById(mr).style.height=document.getElementById(ml).style.height;
			}
		}
		else
		{
			if (eval(document.getElementById(mm).style.height.split('px')[0])>eval(document.getElementById(ml).style.height.split('px')[0]))
			{
  	    		document.getElementById(ml).style.height=document.getElementById(mm).style.height;
  	    		document.getElementById(mr).style.height=document.getElementById(mm).style.height;
			}
			else
			{
  	    		document.getElementById(mm).style.height=document.getElementById(ml).style.height;
  	    		document.getElementById(mr).style.height=document.getElementById(ml).style.height;
			}
		}
	}
}

function InitForm()
{
	SelectState(document.frmBSI.ddlState.value);
	changetablesize('tabLeft','tabResult','tabRight');
}

function InitFreeClassified()
{
	var IsExist=false;
	var hidOffDistrict;

	InitState(document.frmBSI.ddlState.value); 
	
	if (document.frmBSI.hidOffDistrict.value!="") 
	{
		IsExist=true;
		hidOffDistrict=document.frmBSI.hidOffDistrict.value;
	}	

	SelectOffState(document.frmBSI.ddlOffState.value); 
	
	if (IsExist) 
	{
		document.frmBSI.ddlOffDistrict.value=hidOffDistrict;
		SelectOffDistrict(hidOffDistrict); 
	}	
	changetablesize('tabLeft','tabResult','tabRight');
}

function show_directory()
{
	if (document.frmBSI.hidService.value!="")
	{
		if (eval(document.frmBSI.hidService.value)<9999)
		{
			location.href="searchinfo.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city=&service="+document.frmBSI.hidService.value+"&subgroup=&brand=&standard=&level="+document.frmBSI.hidLevel.value+"&sortby=&page=1&alphabet=";
		}
		else
		{
			if (eval(document.frmBSI.hidService.value)==9999)
			{		
				location.href="special_offer_info.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city="+document.frmBSI.hidCity.value+"&service="+document.frmBSI.hidService.value+"&subgroup="+document.frmBSI.hidSubGroup.value+"&brand="+document.frmBSI.hidBrand.value+"&standard="+document.frmBSI.hidQualityStandard.value+"&level="+document.frmBSI.hidLevel.value+"&sortby="+document.frmBSI.hidSortBy.value+"&page=1&alphabet=";
			}
			else
			{
				location.href="free_classifieds.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city="+document.frmBSI.hidCity.value+"&service="+document.frmBSI.hidService.value+"&subgroup="+document.frmBSI.hidSubGroup.value+"&brand="+document.frmBSI.hidBrand.value+"&standard="+document.frmBSI.hidQualityStandard.value+"&level="+document.frmBSI.hidLevel.value+"&sortby="+document.frmBSI.hidSortBy.value+"&page=1&alphabet=";
			}
		}
	}
	else
	{
		location.href="searchinfo.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city=&service=&subgroup=&brand=&standard=&level="+document.frmBSI.hidLevel.value+"&sortby=&page=1&alphabet=";
	}
}

var gname;
function show_doc(link)
{
 	var xMax = 1024, yMax=768;
    var xOffset = (xMax -700)/2, yOffset = (yMax - 400)/2;
   	gname=window.open(link,'centered','width=700,height=400,scrollbars=Yes,resizable=Yes, screenX='+xOffset+',screenY='+yOffset+', top='+yOffset+',left='+xOffset+'');
   	if (window.focus) {gname.focus();}
}

function MoreDetails(thisJeweller)
{
	var strWinAttrib="menubar=no, scrollbars=yes, resizable=no, alwaysRaised=yes, width=680, height=380, top="+(screen.height-400+60)/2+", left="+(screen.width-680-24)/2;
	var strParam = "more_details.asp?JewellerNumber="+thisJeweller;

	if (window_now) window_now.close();
    window_now=window.open(strParam, "MoreDetails", strWinAttrib);
}

function SpecialOffer(thisJeweller)
{
	var strWinAttrib="menubar=no, scrollbars=yes, resizable=no, alwaysRaised=yes, width=680, height=380, top="+(screen.height-400+60)/2+", left="+(screen.width-680-24)/2;
	var strParam = "special_offer.asp?JewellerNumber="+thisJeweller;

	if (window_now) window_now.close();
    window_now=window.open(strParam, "SpecialOffer", strWinAttrib);
}

function SendEnquiry(thisContact, thisMode)
{
	var strParam
	var strWinAttrib="menubar=no, scrollbars=no, resizable=no, alwaysRaised=yes, width=680, height=380, top="+(screen.height-400+60)/2+", left="+(screen.width-680-24)/2;

	if (thisMode==2) strParam = "send_enquiry.asp?JewellerNumber="+thisContact;
	else if (thisMode==1) strParam = "send_enquiry.asp?AgencyNumber="+thisContact;
	else strParam = "send_enquiry.asp";

	if (window_now) window_now.close();
    window_now=window.open(strParam, "EnquiryForm", strWinAttrib);
}

function ShowAlphabetList(thisAlphabet)
{
	location.href="searchinfo.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city="+document.frmBSI.hidCity.value+"&service="+document.frmBSI.hidService.value+"&subgroup="+document.frmBSI.hidSubGroup.value+"&brand="+document.frmBSI.hidBrand.value+"&standard="+document.frmBSI.hidQualityStandard.value+"&sortby="+document.frmBSI.hidSortBy.value+"&page=1&alphabet="+thisAlphabet;
}

function ShowAll()
{
	location.href="searchinfo.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city="+document.frmBSI.hidCity.value+"&service="+document.frmBSI.hidService.value+"&subgroup="+document.frmBSI.hidSubGroup.value+"&brand="+document.frmBSI.hidBrand.value+"&standard="+document.frmBSI.hidQualityStandard.value+"&sortby="+document.frmBSI.hidSortBy.value+"&page=1&alphabet=";
}

function ShowPageList(thisPage)
{
	location.href="searchinfo.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city="+document.frmBSI.hidCity.value+"&service="+document.frmBSI.hidService.value+"&subgroup="+document.frmBSI.hidSubGroup.value+"&brand="+document.frmBSI.hidBrand.value+"&standard="+document.frmBSI.hidQualityStandard.value+"&sortby="+document.frmBSI.hidSortBy.value+"&page="+thisPage+"&alphabet="+document.frmBSI.hidAlphabet.value;
}

function ShowClassifiedPageList(thisPage)
{
	location.href="free_classifieds.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city="+document.frmBSI.hidCity.value+"&service="+document.frmBSI.hidService.value+"&subgroup="+document.frmBSI.hidSubGroup.value+"&brand="+document.frmBSI.hidBrand.value+"&standard="+document.frmBSI.hidQualityStandard.value+"&sortby="+document.frmBSI.hidSortBy.value+"&page="+thisPage+"&alphabet="+document.frmBSI.hidAlphabet.value;
}

function BackToFreeClassifieds()
{
	location.href="free_classifieds.asp?country=IN&state="+document.frmBSI.hidState.value+"&district="+document.frmBSI.hidDistrict.value+"&city="+document.frmBSI.hidCity.value+"&service="+document.frmBSI.hidService.value+"&subgroup="+document.frmBSI.hidSubGroup.value+"&brand="+document.frmBSI.hidBrand.value+"&standard="+document.frmBSI.hidQualityStandard.value+"&level="+document.frmBSI.hidLevel.value+"&sortby="+document.frmBSI.hidSortBy.value+"&page="+document.frmBSI.hidPage.value+"&alphabet="+document.frmBSI.hidAlphabet.value;
}

function BackToHome()
{
	location.href="default.asp"
}

//-->