function launch(strLink,w,h,scrollBars){
 if (screen) {
   LeftPos = ((screen.width)/2)  - (w/2);
   TopPos  = ((screen.height)/2) - (h/2);
  }
  window.open(strLink,'popWin','resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollBars + ',width=' + w + ',height=' + h + ',top=' + TopPos + ',left=' + LeftPos)
}

function validateLogin(){
	memberNo = document.all.login.memberNo.value;
	pwd = document.all.login.pwd.value;
	if(memberNo.length==0){
		alert("Please enter your Skysurfers number");
	} else if(pwd.length==0){
		alert("Please enter your password")
	} else {
		document.all.login.submit();
	}
}

function checkEmail(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}
		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }
		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }
		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    return false
		 }
 		 return true					
	}

function ValidateForm(){
	var emailID=document.frmSample.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
 function showBenefit(benefit){
	theURL = 'Popups/pop_ben.aspx?page='+benefit;
	window.open(theURL, 'benefitPop', 'width=395,height=420,scrollbars=no');
}

function LaunchAlert()
{
  if(window.GetAlert)	
  {
    GetAlert();
  }
}

//To open partners in Skywards.com


function launchPartners(strLink,w,h,resize,scroll)
 {
  if (screen) {
   w=screen.width;
   h=screen.height;
   LeftPos = ((screen.width)/2)  - (w/2);
   TopPos  = ((screen.height)/2) - (h/2);
  }
  var win1 = window.open(strLink,'new_win','resizable='+resize+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scroll + ',width='+ w + ',height=' + h + ',top=' + TopPos + ',left=' + LeftPos)
  win1.focus();
}

function launch(strLink,w,h,resize,scroll)
 {
  if (screen) {
   LeftPos = ((screen.width)/2)  - (w/2);
   TopPos  = ((screen.height)/2) - (h/2);
  }
  var win1 = window.open(strLink,'new_win','resizable='+resize+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scroll + ',width='+ w + ',height=' + h + ',top=' + TopPos + ',left=' + LeftPos)
  win1.focus();
}

