var lsChangecolor="";
    var lsEventstore=""; 
    
    
    var params = {
	firstday:0,
	dtype:'dd/MM/yyyy',
	width:275,
	windoww:300,
	windowh:200,
	border_width:0,
	border_color:'White',
	headerstyle: {
		type:"buttons",
		css:'clsDayName',
		imgnextm:'img/forward.jpg',
		imgprevm:'img/back.jpg'
	},
	monthnames:["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
	daynames:["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
	};
	t=false;
	function ie_ua()
	{
		t=ua;
	}
	function show(id)
	{
		var c1 = new CodeThatCalendar(params);	
		c1.popup(id);	
	}

	function showcalender(id)
	{
		show(id);	
	}
		
	function setorderdate(datevalue)
	{	
		if(datevalue != null && datevalue !='')
		{
			document.DataForm.orderdate.value=datevalue;	
		}
	}

function gotodetail(src,total,jewelername,jeweladdres)
{
	loForm=self.document.form1;		
	loForm.txtshoppingid.value=src;
	loForm.txttotalamount.value=total;
	loForm.hdnjewellername.value=jewelername;
	loForm.hdnjewelleraddress.value=jeweladdres;
	loForm.setAttribute("action","showresellercartdetails.aspx");
	loForm.setAttribute("method","post");
	loForm.submit();
}

function moveBlownup(src)
{
	var myTop = document.body.scrollTop + window.event.clientY  - 75;
	var myLeft = document.body.scrollLeft + window.event.clientX + 12;	
	document.all.blownupDiv.style.visibility = "visible";
	document.all.blownupDiv.style.top = myTop;	
}
function hideBlownUp(src)
{
	document.all.blownupDiv.style.visibility = "hidden";
}
function showBlownUp(src)
{
	var myTop = document.body.scrollTop + window.event.clientY  - 75;
	var myLeft = document.body.scrollLeft + window.event.clientX + 12;
	document.all.imgProd.src=src;
	document.all.imgProd.border=1;
	if (document.all.blownupDiv.style.visibility  = "hidden")
	document.all.blownupDiv.style.visibility = "visible";
	document.all.blownupDiv.style.top = myTop;
	document.all.blownupDiv.style.left = myLeft;
}
function charsonly(e)
{
	if (e.keyCode) keycode=e.keyCode;
     else keycode=e.which;
	if(keycode==9 || keycode==46 || keycode==16 || keycode==32)
	{					//if the key is tab or delete or shiftkey or space key
		return true;
	}
	if (keycode!=8)
	{ //if the key isn't the backspace key (which we should allow)
		if (keycode<65||keycode>90)  //if not a char
		return false //disable key press
	}
}
function numbersonly(e)
{
	if (e.keyCode) keycode=e.keyCode;
     else keycode=e.which;
   	if(keycode==9 || keycode==46 || keycode==16 )
	{				//if the key is tab or delete or shiftkey
		return true;
	}
	if (keycode!=8)
	{ //if the key isn't the backspace key (which we should allow)
		if ((keycode<48||keycode>57) && (keycode<96||keycode>105)) //if not a number
		return false //disable key press
	}
}
function floatsonly(e,txtvalue)
{
	var floatflag;
	if (e.keyCode) keycode=e.keyCode;
     else keycode=e.which;
   	if(keycode==9 || keycode==46 || keycode==16 )
	{								//if the key is tab or delete or shiftkey
		return true;			
	}
	if (keycode!=8)
	{ //if the key isn't the backspace key (which we should allow).
		if(keycode==110 || keycode==190)
		{
			if(txtvalue.indexOf(".")==-1)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		if ((keycode<48||keycode>57) && (keycode<96||keycode>105)) //if not a number
		return false //disable key press
	}
}

function select(idvalue)
{   	
	document.DataForm.record.value=idvalue;
	document.DataForm.record1.value=arguments[1];
	lsEventstore=idvalue;
	lsEventstore1=arguments[1];
	for(var liIndex=0;liIndex!=document.all.length;liIndex++)
	{
		if(document.all[liIndex].id)
		{
			if(document.all[liIndex].tagName=='TR')
			{
				obj =document.all[liIndex];					
				if(document.all[liIndex].id.toString()==idvalue)
				{
					obj.className="change";
				}
				else
				{
					obj.className="change1";
				}
			}
		}			
	}		
}
function whichButton(event)
{	
	if(event.keyCode==13)
	{	
		checkListEvent('search');
	}	
}
function getfromslot(lsNavigationAction)
{
	loForm=self.document.DataForm;		
	loForm.setAttribute("action",lsNavigationAction);
	loForm.setAttribute("method", "post");
	loForm.submit();
}


function next(i,idValue)
{	
	document.DataForm.recorddisplay.value=i;
	document.DataForm.searchword.value=document.DataForm.companyname.value;		
	lsredirectedPage='./MainFrame.aspx';
	submitPage(lsredirectedPage);	
}
function submitPage(redirectedPage)
{
	loForm=self.document.DataForm;		
	loForm.setAttribute("action",redirectedPage);
	loForm.setAttribute("method", "post");
	loForm.submit();		
}
	
/*
 function used by keatn
*/
function whichButton(event)
{	
	if(event.keyCode==13)
	{	
		checkListEvent('search');
	}	
}
function getfromslot(lsNavigationAction)
{
	loForm=self.document.DataForm;		
	loForm.setAttribute("action",lsNavigationAction);
	loForm.setAttribute("method", "post");
	loForm.submit();
}


	
	
function onMouseOverFont(ID)
{
    document.getElementById(ID).style.color="FF6600";    
}
function onMouseOutFont(ID)
{
    document.getElementById(ID).style.color="#3b5ab2";    
}

	
function onMouseOverSubFont(ID)
{   	
alert(document.getElementById('subcategory'+ID).classname);
    document.getElementById('subcategory'+ID).classname="mouseover";
     //alert(document.getElementById(ID).ClassName);
    // alert(document.getElementById(ID).ClassName);
   // document.getElementById(ID).style.color="FF6600"; 
  // document.getElementById(ID).background="include/images/1.jpg";   
}
function onMouseOutSubFont(ID)
{
	document.getElementById('subcategory'+ID).classname="mouseout";
    document.getElementById(ID).style.color="#3b5ab2";
}

function callfrmSubCategory(fsValue)
{
	document.form1.hdnSubCategory.value = fsValue;
	document.form1.setAttribute('Method','POST');
	document.form1.setAttribute('Action','DisplayCategory.aspx');
	document.form1.submit();
}

function callAdminScreen(URL)
{
	document.DataForm.setAttribute('Method','POST');
	document.DataForm.setAttribute('Action',URL);
	document.DataForm.submit();
}

function isNull(val){return(val==null);}

function isDigit(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
	}

function isBlank(val){
	if(val==null){return true;}
	for(var i=0;i<val.length;i++) {
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
		}
	return true;
	}

//-------------------------------------------------------------------
// isInteger(value)
//   Returns true if value contains all digits
//-------------------------------------------------------------------
function isInteger(val){
	if (isBlank(val)){return false;}
	for(var i=0;i<val.length;i++){
		if(!isDigit(val.charAt(i))){return false;}
		}
	return true;
	}
function doredirection(button)
{
	loForm=self.document.form1;	
	if(button=="Cancel")
	{
		loForm.setAttribute("action","LoginDiamond.aspx");
		loForm.setAttribute("method", "post");
		loForm.started.value="cancel";
	}
	else
	{
		loForm.setAttribute("action","PasswordDiamond.aspx");
		loForm.setAttribute("method", "post");
	}
	loForm.submit();
}	

function addtocart(id)
{
	var loForm=document.form1;
	loForm.item_id.value=id;
	loForm.setAttribute('method','post');
	loForm.setAttribute('action','../cart/frmCartOperation.aspx');
	loForm.submit();	
}

function addUpdatedItemtoCart(id)
{
	var loForm=document.form1;
	loForm.hdnAction.value='showItemDetail';	
	loForm.item_id.value=id;	
	loForm.setAttribute('method','post');
	loForm.setAttribute('action','../cart/frmCartOperation.aspx');
	loForm.submit();	
}
function showDetail(id)
{
	var loForm=document.form1;
	loForm.item_id.value=id;
	loForm.hdnAction.value='showItemDetail';
	loForm.setAttribute('method','post');
	loForm.setAttribute('action','DisplayCategory.aspx');
	loForm.submit();			
}

function updateQuality()
{
	var loForm=document.form1;
	loForm.hdnAction.value='showItemDetail';				
	loForm.qualityupdate.value='Y';			
	loForm.setAttribute("action","DisplayCategory.aspx");
	loForm.submit();			
}	

function showListPage(fsValue)
{
	var loForm=document.DataForm;
	loForm.hdnPageType.value=fsValue;
	loForm.setAttribute("Method","Post");
	loForm.setAttribute("action","Admin.aspx");
	loForm.submit();
}

function callAddInItem(fsItemID,URL)
{
	var loForm=document.DataForm;
	loForm.hdnItemSeq.value = fsItemID;
	loForm.setAttribute("Method","Post");
	loForm.setAttribute("action",URL);
	loForm.submit();
}

function MM_swapImgRestore() 
{ 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages()
{
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) 
{
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() 
{ 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


