function launch_survey(){
  popup_vfmail = window.open( "pwsurvey.php", "pwsurvey", "width=630,height=1300,scrollbars=yes,resizable=1,toolbar=0,location=0,menubar=0,status=0,directories=0")
  popup_vfmail.blur()
  window.focus()
}

function launch_calculator(){
  window.open( "calculator.html", "calculator", "width=390,height=390,scrollbars=no,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0")
}

function clearText(thisField)
  {
    if (thisField.defaultValue == thisField.value)
      thisField.value = '';
  }

function jumpMenu(selObj,restore){ //v3.0
  eval("parent.location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
  }

function insertTop() { 
document.write('<img src="http://www.polarisworldspain.com/Images/newtop.jpg" alt="Polaris World brought to you by Lighthouse" width="910" height="170" border="0" style="margin: 0; padding:0;" />');
/*if (!thistop) { thistop = 'general'; }
document.write('<img src="http://www.polarisworldspain.com/Images/top-',thistop,'.jpg" border="0" alt="Polaris World brought to you by Lighthouse" />');
document.write('</td><td width="240" valign="top" align="center" style="background: url(http://www.polarisworldspain.com/Images/magnifyingglass.gif) top right no-repeat #FFF; border: solid 1px #2d88cd; margin: 0px; padding: 4px; font: normal 11px Verdana, Arial, Helvetica, sans-serif; ">');
document.write('<p class="tools"><strong>Useful website<br>SEARCH TOOLS</strong></p><p class="tools2">Choose what you want to<br />do on our site from this drop down...</p><form style="margin: 12px 0px;"><select name="tools" size="1" onChange="jumpMenu(this,1)"><option>What Do you Want to do Today?</option><option value="http://www.polarisworldspain.com/dvdpolarisworld.php">Request a Brochure and DVD Pack</option><option value="http://www.polarisworldspain.com/callback-request.php">Request a Call Back</option><option value="http://www.polarisworldspain.com/polaris-world-resorts.php">Look at Resort Information</option><option value="http://www.polarisworldspain.com/howtobuy.php">Find out How To Buy</option><option value="http://www.polarisworldspain.com/polaris-world-rentals.php">Rent out your Polaris Property</option><option value="http://www.polarisworldspain.com/completion-guide.php">Learn what happens at "Completion"</option><option value="http://www.polarisworldspain.com/polaris-world-mortgages.php">Request Mortgage Information</option><option value="http://www.polarisworldspain.com/furniture-packs.php">Request Furniture Pack Information</option><option value="http://www.polarisworldspain.com/polaris-world-media.php">View Videos and Photos of Polaris</option></select></form>...Or type what you are looking for here:<br />');
document.write('<!-- Google CSE Search Box Begins  -->');
document.write('<form action="http://www.polarisworldspain.com/sitesearchresults.php" id="searchbox_008449560012006755414:de92r2xmydm" style="margin-top: 5px;">');
document.write('<input type="hidden" name="cx" value="008449560012006755414:de92r2xmydm" />');
document.write('<input type="hidden" name="cof" value="FORID:11" />');
document.write('<input type="text" name="q" size="35" />');
document.write('<img src="http://www.google.com/coop/images/google_custom_search_smnar.gif" alt="Google Custom Search" style="margin:0 100px 0 0" />');
document.write('<input type="submit" name="sa" value="Search" />');
document.write('</form>');
document.write('<!-- Google CSE Search Box Ends -->');
document.write('</td></tr></table>');*/
}

function insertTopOLDwFLASH() 
{ 
document.write('<table border="0" cellpadding="0" cellspacing="0" width="980"><tr><td valign="top" align="left">');
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="725" height="200" id="top" align="middle">'); 
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="topblue.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="topblue.swf" quality="high" bgcolor="#ffffff" width="725" height="200" name="top" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
document.write('</td><td width="240" valign="top" align="center" style="background: url(Images/magnifyingglass.gif) top right no-repeat #FFF; border: solid 1px #2d88cd; padding: 5px; font: normal 11px Verdana, Arial, Helvetica, sans-serif; ">');
document.write('<p class="tools"><strong>Useful website<br>SEARCH TOOLS</strong></p><p class="tools2">Choose what you want to<br />do on our site from this drop down...</p><form style="margin: 12px 0px;"><select name="tools" size="1" onChange="jumpMenu(this,1)"><option>What Do you Want to do Today?</option><option value="http://www.polarisworldspain.com/dvdpolarisworld.php">Request a Brochure and DVD Pack</option><option value="http://www.polarisworldspain.com/callback-request.php">Request a Call Back</option><option value="http://www.polarisworldspain.com/polaris-world-resorts.php">Look at Resort Information</option><option value="http://www.polarisworldspain.com/howtobuy.php">Find out How To Buy</option><option value="http://www.polarisworldspain.com/polaris-world-rentals.php">Rent out your Polaris Property</option><option value="http://www.polarisworldspain.com/completion-guide.php">Learn what happens at "Completion"</option><option value="http://www.polarisworldspain.com/polaris-world-mortgages.php">Request Mortgage Information</option><option value="http://www.polarisworldspain.com/furniture-packs.php">Request Furniture Pack Information</option><option value="http://www.polarisworldspain.com/polaris-world-media.php">View Videos and Photos of Polaris</option></select></form>... Or type what you are looking for here:<br />');
document.write('<!-- Google CSE Search Box Begins  -->');
document.write('<form action="http://www.polarisworldspain.com/sitesearchresults.php" id="searchbox_008449560012006755414:de92r2xmydm" style="margin-top: 5px;">');
document.write('<input type="hidden" name="cx" value="008449560012006755414:de92r2xmydm" />');
document.write('<input type="hidden" name="cof" value="FORID:11" />');
document.write('<input type="text" name="q" size="35" />');
document.write('<img src="http://www.google.com/coop/images/google_custom_search_smnar.gif" alt="Google Custom Search" style="margin:0 100px 0 0" />');
document.write('<input type="submit" name="sa" value="Search" />');
document.write('</form>');
document.write('<!-- Google CSE Search Box Ends -->');
document.write('</td></tr></table>');
}

function insertTopOLD() 
{ 
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="980" height="200" id="Definitive" align="middle">'); 
document.write('<param name="allowScriptAccess" value="sameDomain" />');
document.write('<param name="movie" value="Definitive.swf" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="bgcolor" value="#ffffff" />');
document.write('<embed src="Definitive.swf" quality="high" bgcolor="#ffffff" width="980" height="200" name="Definitive" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
} 


function insertSmallVideo() 
{ 
document.write('<div style="width: 195px; margin: 0 auto; height: 175px; padding: 0; text-align: center;">');
document.write("<embed height='148px' width'190px' src='http://www.solchannel.com/scrubber_embed3.swf?id_video=243' allowscriptaccess='sameDomain' wmode='transparent' quality='high'  id='flash_embed' name='detectionExample' allowfullscreen='true' bgcolor='#FFFFFF' type='application/x-shockwave-flash' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab'  pluginspage='http://www.adobe.com/go/getflashplayer' ></embed>"); 
document.write('<br /><a href="http://www.solchannel.com" target="blank" style="font-family:Verdana, Arial, Helvetica, sans-serif; text-align:right; font-size:9px; text-decoration:none;">Watch Other Videos</a>');
document.write('<iframe src="http://www.solchannel.com/google_embed.php" frameborder="0" scrolling="no" width="150" height="10"></iframe>');
document.write("</div>");
}
   
function Item(){
this.length = Item.arguments.length 
for (var i = 0; i < this.length; i++)
  this[i] = Item.arguments[i]
}

function Fecha() {
var nmes = new Item('January','February','March','April','May','June','July','August','September','October','November','December')
var ahora
var fecha = new Date()
var ano = fecha.getYear()
var mes = fecha.getMonth()
var dia = fecha.getDay()
var aux = "" + fecha

if (ano<10) {
 ano2 = "200" + eval(ano)
}
else if (ano<80) {
 ano2 = "20" + ano
} 
else if (ano<=99) {
 ano2 = "19" + ano
}
else if (ano<1000) {
 ano2 = eval(ano) + eval(1900)
}
else {
 ano2 = ano
}

ahora = eval(aux.substring(7, 10)) + " " + nmes[mes] + " " + ano2
return ahora
}

function Fechaesp() {
var nmes = new Item('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre')
var ahora
var fecha = new Date()
var ano = fecha.getYear()
var mes = fecha.getMonth()
var dia = fecha.getDay()
var aux = "" + fecha

if (ano<10) {
 ano2 = "200" + eval(ano)
}
else if (ano<80) {
 ano2 = "20" + ano
} 
else if (ano<=99) {
 ano2 = "19" + ano
}
else if (ano<1000) {
 ano2 = eval(ano) + eval(1900)
}
else {
 ano2 = ano
}

ahora = eval(aux.substring(7, 10)) + " de " + nmes[mes] + " de " + ano2
return ahora
}

function validate(){     

    if (polarisform.Fullname.value=='') {
    alert("Please, insert your fullname.");
    polarisform.Fullname.focus();
    return false;
  }   
    if (polarisform.Email.value=='') {
    alert("Please, insert a valid email address.");
    polarisform.Email.focus();
    return false;
  }
    if (polarisform.Phone.value=='') {
    alert("Please, insert your telephone number.");
    polarisform.Phone.focus();
    return false;
  }
    return true;
  }

function validateSpecific(){     

    if ((specific.tbxName.value=='')&&(specific.tbxSurname.value=='')) {
    alert("Please, insert your name and/or surname.");
    specific.tbxName.focus();
    return false;
  }   
    if (specific.tbxPhone.value=='') {
    alert("Please, insert your telephone number.");
    specific.tbxPhone.focus();
    return false;
  }
    if (specific.tbxEmail.value=='') {
    alert("Please, insert a valid email address.");
    specific.tbxEmail.focus();
    return false;
  }
    return true;
  }

function validatecomp(){     

    if ((completion.name.value=='')&&(completion.surname.value=='')) {
    alert("Please, insert your name and/or surname.");
    completion.name.focus();
    return false;
  }   
    if (completion.nhemail.value=='') {
    alert("Please, insert a valid email address.");
    completion.nhemail.focus();
    return false;
  }
    if (completion.telephone.value=='') {
    alert("Please, insert your telephone number.");
    completion.telephone.focus();
    return false;
  }
    return true;
  }


function validateSurvey(){     

    if (survey.Name.value=='') {
    alert("Please, insert your full name.");
    survey.Name.focus();
    return false;
  }   
    if (survey.Email.value=='') {
    alert("Please, insert a valid email address.");
    survey.Email.focus();
    return false;
  }
    if (survey.Telephone.value=='') {
    alert("Please, insert your telephone number.");
    survey.Telephone.focus();
    return false;
  }
    return true;
  }

function validateBottom(){     

    if (bottomform.bname.value=='') {
    alert("Please, insert your full name.");
    bottomform.bname.focus();
    return false;
  }   
    if (bottomform.bemail.value=='') {
    alert("Please, insert a valid email address.");
    bottomform.bemail.focus();
    return false;
  }
    if (bottomform.btelephone.value=='') {
    alert("Please, insert a valid telephone number with the international dialup code.");
    bottomform.btelephone.focus();
    return false;
  }
    return true;
  }

function validatePWSurvey(){     

    if (pwsurvey.Name.value=='') {
    alert("Please, insert your full name.");
    pwsurvey.Name.focus();
    return false;
  }   
    if (pwsurvey.Telephone.value=='') {
    alert("Please, insert your telephone number.");
    pwsurvey.Telephone.focus();
    return false;
  }
    if (pwsurvey.Email.value=='') {
    alert("Please, insert a valid email address.");
    pwsurvey.Email.focus();
    return false;
  }
    return true;
  }


function validateSF(){     

    if (sfform.first_name.value=='') {
    alert("Please, insert your full name.");
    sfform.first_name.focus();
    return false;
  }   
    if (sfform.last_name.value=='') {
    alert("Please, insert your full name.");
    sfform.last_name.focus();
    return false;
  }
    if (sfform.email.value=='') {
    alert("Please, insert a valid email address.");
    sfform.email.focus();
    return false;
  }
    return true;
  }

function validateSFbottom(){     

    if (bottomf.first_name.value=='') {
    alert("Please, insert your full name.");
    bottomf.first_name.focus();
    return false;
  }   
    if (bottomf.last_name.value=='') {
    alert("Please, insert your full name.");
    bottomf.last_name.focus();
    return false;
  }
    if (bottomf.email.value=='') {
    alert("Please, insert a valid email address.");
    bottomf.email.focus();
    return false;
  }
    return true;
  }

function validateSFtop(){     

    if (topnewf.first_name.value=='') {
    alert("Please, insert your full name.");
    bottomf.first_name.focus();
    return false;
  }   
    if (topnewf.last_name.value=='') {
    alert("Please, insert your full name.");
    topnewf.last_name.focus();
    return false;
  }
    if (topnewf.email.value=='') {
    alert("Please, insert a valid email address.");
    topnewf.email.focus();
    return false;
  }
    return true;
  }

function SetSelectedDate()
{
    var TodayDate = new Date();
    var Day = TodayDate.getDate()-1;
    var Month = TodayDate.getMonth();

    document.AlphaBedsSearch.FromDateDay.selectedIndex = Day;
    document.AlphaBedsSearch.FromDateMonth.selectedIndex = Month;
}

 function valbtranfer() {
  	if((banktranfer.email.value)!=(banktranfer.email2.value)) { 
		alert("Please, make sure your email is correct.");
   		banktranfer.email.focus();
		return false;
		}
	return true;
}

// POPOVER info

var w3c=(document.getElementById)? true: false;
var ns4=(document.layers)?true:false;
var ie5=(w3c && document.all)? true : false;
var ns6=(w3c && !document.all)? true: false;
var d=document;
currIDb=null; xoff=0; yoff=0;
currRS=null; rsxoff=0; rsyoff=0;
oldac=null; newac=null; zdx=200; mx=0; my=0;
function preloadBttns(){
var btns=new Array();
btns[0]=new Image(); btns[0].src="images/minxp.gif";
btns[1]=new Image(); btns[1].src="images/maxxp.gif";
btns[2]=new Image(); btns[2].src="images/closexp.gif";
btns[3]=new Image(); btns[3].src="images/resizexp.gif";
}
preloadBttns();
function hidebox(id){
if(w3c){
d.getElementById(id+'_b').style.display='none';
d.getElementById(id+'_s').style.display='none';
}}
function showbox(id){
if(w3c){
var bx=d.getElementById(id+'_b');
var sh=d.getElementById(id+'_s');
bx.style.display='block';
sh.style.display='block';
sh.style.zIndex=++zdx;
bx.style.zIndex=++zdx;
changez(bx);
}}
function changecontent(id,text){
if(!document.getElementById(id+'_b').isExt){
var d=document.getElementById(id+'_c');
if(ns6)d.style.overflow="hidden";
d.innerHTML=text;
if(ns6)d.style.overflow="block";
}else document.getElementById(id+'_ifrm').src=text;
}
function minimize(){
if(w3c){
d.getElementById(this.cid+"_b").style.height=(ie5)? '28px':'24px';
d.getElementById(this.cid+"_s").style.height='28px';
d.getElementById(this.cid+"_c").style.display='none';
d.getElementById(this.cid+"_rs").style.display='none';
ns6bugfix();
}}
function restore(){
if(w3c){
d.getElementById(this.cid+"_b").style.height=this.h+'px';
d.getElementById(this.cid+"_s").style.height=(ie5)? this.h+'px':this.h+5+'px';
d.getElementById(this.cid+"_c").style.display='block';
d.getElementById(this.cid+"_rs").style.display='block';
ns6bugfix();
}}
function ns6bugfix(){
if(ns6)setTimeout('self.resizeBy(0,1); self.resizeBy(0,-1);', 100);
}
function trackmouse(evt){
mx=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
my=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
if(!ns6)movepopup();
if((currIDb!=null)||(currRS!=null))return false;
}
function movepopup(){
if((currIDb!=null)&&w3c){
var x=mx+xoff;
var y=my+yoff;
currIDb.style.left=x+'px';
currIDs.style.left=x+8+'px';
currIDb.style.top=y+'px';
currIDs.style.top=y+8+'px';
}
if((currRS!=null)&&w3c){
var rx=mx+rsxoff;
var ry=my+rsyoff;
var c=currRS;
d.gEl=d.getElementById;
d.gEl(c.cid+"_extWA").style.display="block";
c.style.left=Math.max(rx,((ie5)?88:92))+'px';
c.style.top=Math.max(ry,((ie5)?68:72))+'px';
d.gEl(c.cid+"_b").style.width=Math.max(rx+((ie5)?12:8),100)+'px';
d.gEl(c.cid+"_b").style.height=Math.max(ry+((ie5)?12:8),80)+'px';
d.gEl(c.cid+"_t").style.width=Math.max(rx+((ie5)?4:3),((ns6)?95:92))+'px';
d.gEl(c.cid+"_btt").style.left=parseInt(d.gEl(c.cid+"_t").style.width)-48+'px';
d.gEl(c.cid+"_s").style.width=Math.max(rx+12,((ie5)?100:104))+'px';
d.gEl(c.cid+"_s").style.height=Math.max(ry+((ie5)?12:13),((ie5)?80:86))+'px';
d.gEl(c.cid+"_c").style.width=Math.max(rx-((ie5)?-5:5),((ie5)?92:87))+'px';
d.gEl(c.cid+"_c").style.height=Math.max(ry-((ie5)?24:28),44)+'px';
d.gEl(c.cid+"_max").h=parseInt(d.gEl(c.cid+"_b").style.height);
}
return false;
}
function stopRS(){
d.getElementById(this.cid+"_extWA").style.display="none";
currRS=null;
}
function startRS(evt){
var ex=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
var ey=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
rsxoff=parseInt(this.style.left)-ex;
rsyoff=parseInt(this.style.top)-ey;
currRS=this;
if(ns6)d.getElementById(this.cid+"_c").style.overflow='hidden';
return false;
}
function changez(v){
var th=(v!=null)?v:this;
if(oldac!=null)d.getElementById(oldac.cid+"_t").style.backgroundColor=oldac.inactivecolor;
if(ns6)d.getElementById(th.cid+"_c").style.overflow='auto';
oldac=th;
d.getElementById(th.cid+"_t").style.backgroundColor=th.activecolor;
d.getElementById(th.cid+"_s").style.zIndex=++zdx;
th.style.zIndex=++zdx;
d.getElementById(th.cid+"_rs").style.zIndex=++zdx;
}
function stopdrag(){
currIDb=null;
document.getElementById(this.cid+"_extWA").style.display="none";
ns6bugfix();
}
function grab_id(evt){
var ex=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
var ey=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
xoff=parseInt(d.getElementById(this.cid+"_b").style.left)-ex;
yoff=parseInt(d.getElementById(this.cid+"_b").style.top)-ey;
currIDb=d.getElementById(this.cid+"_b");
currIDs=d.getElementById(this.cid+"_s");
d.getElementById(this.cid+"_extWA").style.display="block";
return false;
}
function subBox(x,y,w,h,bgc,id){
var v=d.createElement('div');
v.setAttribute('id',id);
v.style.position='absolute';
v.style.left=x+'px';
v.style.top=y+'px';
v.style.width=w+'px';
v.style.height=h+'px';
if(bgc!='')v.style.backgroundColor=bgc;
v.style.visibility='visible';
v.style.padding='0px';
return v;
}
function get_cookie(Name) {
var search=Name+"=";
var returnvalue="";
if(d.cookie.length>0){
offset=d.cookie.indexOf(search);
if(offset!=-1){
offset+=search.length;
end=d.cookie.indexOf(";",offset);
if(end==-1)end=d.cookie.length;
returnvalue=unescape(d.cookie.substring(offset,end));
}}
return returnvalue;
}
function popUp(x,y,w,h,cid,text,bgcolor,textcolor,fontstyleset,title,titlecolor,titletextcolor,bordercolor,scrollcolor,shadowcolor,showonstart,isdrag,isresize,oldOK,isExt,popOnce){
var okPopUp=false;
if (popOnce){
if (get_cookie(cid)==""){
okPopUp=true;
d.cookie=cid+"=yes"
}}
else okPopUp=true;
if(okPopUp){
if(w3c){
w=Math.max(w,100);
h=Math.max(h,80);
var rdiv=new subBox(w-((ie5)?12:8),h-((ie5)?12:8),7,7,'',cid+'_rs');
if(isresize){
rdiv.innerHTML='<img src="images/resizexp.gif" width="7" height="7" />';
rdiv.style.cursor='move';
}
var tw=(ie5)?w:w+4;
var th=(ie5)?h:h+6;
var shadow=new subBox(x+8,y+8,tw,th,shadowcolor,cid+'_s');
if(ie5)shadow.style.filter="alpha(opacity=50)";
else shadow.style.MozOpacity=.5;
shadow.style.zIndex=++zdx;
var outerdiv=new subBox(x,y,w,h,bordercolor,cid+'_b');
outerdiv.style.borderStyle="outset";
outerdiv.style.borderWidth="1px";
outerdiv.style.borderColor=bordercolor;
outerdiv.style.zIndex=++zdx;
tw=(ie5)?w-8:w-5;
th=(ie5)?h+4:h-4;
var titlebar=new subBox(2,2,tw,20,titlecolor,cid+'_t');
titlebar.style.overflow="hidden";
titlebar.style.cursor="default";
var tmp=(isresize)?'<img src="images/minxp.gif" width="16" height="16" id="'+cid+'_min"><img src="images/maxxp.gif" width="16" height="16"  id="'+cid+'_max" />':'';
titlebar.innerHTML='<span style="position:absolute; left:3px; top:1px; font:bold 10pt sans-serif; color:'+titletextcolor+'; height:18px; overflow:hidden; clip-height:16px;">'+title+'</span><div id="'+cid+'_btt" style="position:absolute; width:48px; height:16px; left:'+(tw-48)+'px; top:2px; text-align:right">'+tmp+'<img src="images/closexp.gif" width="16" height="16" id="'+cid+'_cls" /></div>';
tw=(ie5)?w-7:w-13;
var content=new subBox(2,24,tw,h-36,bgcolor,cid+'_c');
content.style.borderColor=bordercolor;
content.style.borderWidth="1px";
if(isExt){
content.innerHTML='<iframe id="'+cid+'_ifrm" src="'+text+'" width="100%" height="100%"></iframe>';
content.style.overflow="hidden";
}else{
if(ie5)content.style.scrollbarBaseColor=scrollcolor;
content.style.borderStyle="inset";
content.style.overflow="auto";
content.style.padding="0px 2px 0px 4px";
content.innerHTML=text;
content.style.font=fontstyleset;
content.style.color=textcolor;
}
var extWA=new subBox(2,24,0,0,'',cid+'_extWA');
extWA.style.display="none";
extWA.style.width='100%';
extWA.style.height='100%';
outerdiv.appendChild(titlebar);
outerdiv.appendChild(content);
outerdiv.appendChild(extWA);
outerdiv.appendChild(rdiv);
d.body.appendChild(shadow);
d.body.appendChild(outerdiv);
d.gEl=d.getElementById;
if(!showonstart)hidebox(cid);
var wB=d.gEl(cid+'_b');
wB.cid=cid;
wB.isExt=(isExt)?true:false;
var wT=d.gEl(cid+'_t');
wT.cid=cid;
if(isresize){
var wRS=d.gEl(cid+'_rs');
wRS.cid=cid;
var wMIN=d.gEl(cid+'_min');
wMIN.cid=cid;
var wMAX=d.gEl(cid+'_max');
wMAX.h=h;
wMAX.cid=cid;
wMIN.onclick=minimize;
wMAX.onclick=restore;
wRS.onmousedown=startRS;
wRS.onmouseup=stopRS;
}
var wCLS=d.gEl(cid+'_cls'); //8
var wEXTWA=d.gEl(cid+'_extWA'); //11
wB.activecolor=titlecolor;
wB.inactivecolor=scrollcolor;
if(oldac!=null)d.gEl(oldac.cid+"_t").style.backgroundColor=oldac.inactivecolor;
oldac=wB;
wCLS.onclick=new Function("hidebox('"+cid+"');");
wB.onmousedown=function(){ changez(this) }
if(isdrag){
wT.onmousedown=grab_id;
wT.onmouseup=stopdrag;
}
}else{
if(oldOK){
var ctr=new Date();
ctr=ctr.getTime();
var t=(isExt)?text:'';
var posn=(ns4)? 'screenX='+x+',screenY='+y: 'left='+x+',top='+y;
var win=window.open(t , "abc"+ctr , "status=no,menubar=no,width="+w+",height="+h+",resizable="+((isresize)?"yes":"no")+",scrollbars=yes,"+posn);
if(!isExt){
t='<html><head><title>'+title+'</title></head><body bgcolor="'+bgcolor+'"><font style="font:'+fontstyleset+'; color:'+textcolor+'">'+text+'</font></body></html>';
win.document.write(t);
win.document.close();
}}}}}
if(ns6)setInterval('movepopup()',40);
if(w3c){
d.onmousemove=trackmouse;
d.onmouseup=new Function("currRS=null");
}

function getexpirydate( nodays){
var UTCstring;
Today = new Date();
nomilli=Date.parse(Today);
Today.setTime(nomilli+nodays*24*60*60*1000);
UTCstring = Today.toUTCString();
return UTCstring;
}
function getcookie(cookiename) {
 var cookiestring=""+document.cookie;
 var index1=cookiestring.indexOf(cookiename);
 if (index1==-1 || cookiename=="") return ""; 
 var index2=cookiestring.indexOf(';',index1);
 if (index2==-1) index2=cookiestring.length; 
 return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}
function setcookie(name,value,duration){
cookiestring=name+"="+escape(value)+";EXPIRES="+getexpirydate(duration);
document.cookie=cookiestring;
//document.write("Saved");
if(!getcookie(name)){
return false;
}
else{
return true;
}
}
function date1(){
now = new Date();
then = new Date(" Jan 01 1970 00:00:00");
seconds=now-then/1000;
month=1+now.getMonth();
day=now.getDate();
year=now.getFullYear();
document.write( day+"-"+month+"-"+year+"");
}
function checkout(){
		if(getcookie('buy')=="yes")
		{
			return true;
		}
		else
		{
			window.location.href = "default.htm";
			openIT('mc.htm',410,410,null,null,'mywinname01');
		}
}

function cookiecheck(){
var currentvalue;
var uservalue =1;
var popoverdelay = 1000;
if(getcookie('popover') > 0){
currentvalue = getcookie('popover');
if(currentvalue == (uservalue+1))
{
}
else
{
currentvalue = parseInt(currentvalue) + 1;
setcookie('popover', currentvalue ,364);
setTimeout('showbox(\'mypop2\');', popoverdelay);
}
}
else
{
setcookie('popover',2,364);
setTimeout('showbox(\'mypop2\');', popoverdelay);
}
}

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_validateForm() { //v4.0
	  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
	  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
		if (val) { nm=val.id; if ((val=val.value)!="") {
		  if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
			if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
		  } else if (test!='R') { num = parseFloat(val);
			if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
			if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
			  min=test.substring(8,p); max=test.substring(p+1);
			  if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
		} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
	  } if (errors) alert('The following error(s) occurred:\n'+errors);
	  document.MM_returnValue = (errors == '');
	}

