var sitename="http://localhost/RelianceNews/";
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_swapImgRestore()
 { //v3.0
  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_findObj(n, d) 
{ //v4.01
  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() { //v3.0
  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];}
}

function RQf_Validator()
 {
			
		if (document.getElementById("txtName").value == "")
		{
			alert("Please Insert Name");
			document.getElementById("txtName").focus();
			return false;
		}
												
		if	(document.getElementById("txtEmail").value=="")
		{
  			alert("email Cannot be Blank ");
  			document.getElementById("txtEmail").focus();
  			return false;
		} 
	
		var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
		var emailid=document.getElementById("txtEmail").value;
		var matchArray = emailid.match(emailPat);
	    if (matchArray == null)
		{
           alert("Your email address seems incorrect. Please try again.");
           document.getElementById("txtEmail").focus();
           return false;
		}
		if(document.getElementById("txtWebsite").value != "")
		{
			var Url="^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$";
			var tempURL=document.getElementById("txtWebsite").value;
			var matchURL=tempURL.match(Url);
			if(matchURL==null)
			{
				alert("Web URL does not look valid");
				document.getElementById("txtWebsite").focus();
				return false;
			}
		}			
		if (document.getElementById("ddl2dob").value == "0")
		{
			alert("Please select Month");
			document.getElementById("ddl2dob").focus();
			return false;
		}			
	    if(isNaN(document.getElementById("txtPin").value)==true)
	    {
	         alert("Pin code must be Integer");
	         return false;
	    } 
	    if(isNaN(document.getElementById("txtWaist").value)==true)
	    {
	         alert("Waist must be Integer"); 
	         return false;
	    } 
        if(isNaN(document.getElementById("txtHips").value)==true)
        {
	         alert("Hips must be Integer"); 
	         return false;
	     } 
        if(isNaN(document.getElementById("txtCorB").value)==true)
        {
	         alert("Chest/Bust must be Integer"); 
	         return false;
	    }	       
	}		
function C_validate()
{		    
	if (document.getElementById("txtName").value == "")
	     {
					alert("Please Insert Name");
					document.getElementById("txtName").focus();
					return false;
		 }
	
	if	(document.getElementById("txtEmail").value=="")
	     {
		           alert("email Cannot be Blank ");
		           document.getElementById("txtEmail").focus();
		           return false;
	     } 

	var emailPat = /^(\".*\"|[A-Za-z]\w*)@(\[\d{1,3}(\.\d{1,3}){3}]|[A-Za-z]\w*(\.[A-Za-z]\w*)+)$/;
	var emailid=document.getElementById("txtEmail").value;
	var matchArray = emailid.match(emailPat);
    if (matchArray == null)
	{
       alert("Your email address seems incorrect. Please try again.");
       document.getElementById("txtEmail").focus();
       return false;
	}
	if(document.getElementById("txtWebsite").value != "")
	{
		var Url="^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$";
		var tempURL=document.getElementById("txtWebsite").value;
		var matchURL=tempURL.match(Url);
		if(matchURL==null)
		{
			alert("Web URL does not look valid");
			document.getElementById("txtWebsite").focus();
			return false;
		}
	}			
	if (document.getElementById("ddl2dob").value == "0")
	    {
					alert("Please select Month");
					document.getElementById("ddl2dob").focus();
	    }		    
    if(isNaN(document.getElementById("txtPin").value)==true)
        {
                    alert("Pin code must be Integer");
                    return false;
        }
                   
}
function Conf_Delete()
{
	var conf = window.confirm("Are you sure you want to delete ?")
	return(conf);
}
function Conf_Deleteforselct()
{
	var conf = window.confirm("First select name!")
	return(conf);
}
function confirm_delete()
{
  if (confirm("Are you sure you want to delete ?")==true)
    return true;
  else
    return false;
}

function confirm_delete_new(spanChk1)
{
	spanChk=document.getElementById(spanChk1);
    var oItem = spanChk;
    var theBox=oItem;
    xState=theBox.checked;    
    elm=theBox.form.elements;
    j=0;
	for(i=0;i<elm.length;i++)
		{
			if(elm[i].type=="checkbox")
				{
					if(elm[i].checked==true)
					{
						j=1;
					}
				}		
		}
	if(j==0)
	{
		alert('Please select an Item');
		return false;
	}
	else
	{
		return confirm('Are you sure you want to delete');
	}
	return true;
}

 var site="/CMS";                                           
var pre="ctl00$ContentPlaceHolder1$";

function calendarPicker(strTxtRef)
{										 									 
	window.open(sitename + 'Controls/Calendar.aspx?field=' + strTxtRef +'','calendarPopup','titlebar=no,left=350,top=340,width=300,height=230,resizable=no');				
}

