function DetailModal(src,width,height,ReloadFlag){
		styles = 'dialogWidth='+width+'px;dialogHeight='+height+'px;dialogTop=0px;dialogLeft=0px;status=no;help=no;';
		//alert(src)
		var n = 0;
		window.showModalDialog(src,window,styles); 
		if (ReloadFlag == "1") 
		{
			window.location.reload()
		}
		//src = path+"product_detail.asp?Qid="+Qid;
		//winstyle = "height=500,width=482,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,top=20,left=20";
		//window.open(src,'detail',winstyle);
		
	}
	
	function DetailModalGetValue(src,width,height,strobject){
		styles = 'dialogWidth='+width+'px;dialogHeight='+height+'px;dialogTop=0px;dialogLeft=0px;status=no;help=no;';
		//alert(strobject)
		sp_param = strobject.split("-$-");
		
		for(i=0;i<=sp_param.length;i++)
		{
			alert(eval('document.all.'+sp_param[i]+'.value'))
		}
		window.showModalDialog(src,window,styles); 		
	}
	// Test
	function RadioButtonSelectAll(strrdb)
	{
	//alert(strrdb);
	   var f = document.all; 
	   rdb_select = strrdb.split(",");
	   for(i=0;i<rdb_select.length;i++)
		{
			//alert(rdb_select[i]);
			eval('document.all.'+rdb_select[i]+'.checked= true'); 
		}
	}
	//End Test
	
function DetailModalParam(src,values,width,height,ReloadFlag){
//alert(values)
//alert(src)
		styles = 'dialogWidth='+width+'px;dialogHeight='+height+'px;dialogTop=150px;dialogLeft=250px;status=no;help=no;';
		sp_param = values.split("-$-");
	//alert(sp_param.length);
	//alert(sp_param[1]);
		src = src+"-\?-params="+values
		var ar = new Array(window,  sp_param[1]);
		window.showModalDialog(src,ar,styles); 	
	    if (ReloadFlag == "1") 
		{
			window.location.reload()
		}
	}
function winpopup(src,width,height) {
		open(src,"popup", "width="+width+" ,height="+height+",location=0,resiable=0, Status=yes,menubar=0,scrollbars=yes");	
}

function formatCurrency(num,dot) {
			num = num.toString().replace(/\$|\,/g,'');
			if(isNaN(num))
						num = "0";
						sign = (num == (num = Math.abs(num)));
						num = Math.floor(num*100+0.50000000001);
						cents = num%100;
						num = Math.floor(num/100).toString();
			if(cents<10)
				cents = "0" + cents;
			for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
						num = num.substring(0,num.length-(4*i+3))+','+
						num.substring(num.length-(4*i+3));
						if (dot == 1)
						{
						return (((sign)?'':'-') + num);
						}
						else
						{
						return (((sign)?'':'-') + num + '.' + cents);
						}
			}
			
function changetomoney(data)
			{
				rep_data = data.replace(",",'')
				return rep_data
			}


  function TrimCheck(key)
		{
			sp =key.split(" ");
				ch = 0
			 	for (st = 0;st<sp.length;st++){
					if (sp[st] == ""){
						ch++;
					}
				}
				if (eval(sp.length) ==eval(ch)){
							return true;}
				else{
							return false;}
		}
  function check_email(e) {
			ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
			for(i=0; i < e.length ;i++){
			if(ok.indexOf(e.charAt(i))<0){ 
			return (false);
			}	
			} 
			if (document.images) {
			re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
			re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
			if (!e.match(re) && e.match(re_two)) {
			return (-1);		
			} 
			}
			}

  
function WarnInput(key,name)
	{
			alert(" Please Insert "+ name +"")
			key.focus();
	}		
	
function Warncheck(key,name)
	{
			alert(" Please check "+ name +" again !! ")
			key.focus();
	}		
	
function Warnselbox(key,name)
	{
			alert(" Please select "+ name +"  ")
			key.focus();
	}
	
	function ClearValue(obj) {
		for (i=0;i<obj.elements.length;i++) {
			if (obj.elements[i].type == 'select-one') {
				obj.elements[i].selectedIndex = 0;
			} else if(obj.elements[i].type == 'text') {
				obj.elements[i].value = '';
			} else if(obj.elements[i].type == 'textarea') {
				obj.elements[i].value = '';
			} 
		}
	}
		
