function minimum(dz,ss)
{

//text="";


//2009 2009

// SEMANA SANTA MIN 5
//hsdate="4/4/2009";
//hedate="12/4/2009";
//overlap(ss,dz,hsdate,hedate)
//if (hold > 0 ) {nodis=15 }
//if (hold > 0 && (dz < 5 ))
//{
//texteng = "On these dates there is a minimum booking requirement of 5 nights.";
//textspan = "En estas fechas el minimo de noches es 5";

//if (lang == "eng")
//{text = texteng}
//if (lang == "span")
//{text = textspan}

//window.alert(text)
//return false;
//}

// PUENTE DE MAYO MIN 3
hsdate="1/5/2009";
hedate="3/5/2009";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 3 ))
{
texteng = "On these dates there is a minimum booking requirement of 3 nights.";
textspan = "En estas fechas el mínimo de noches es 3";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// OCTOBER
hsdate="9/10/2009";
hedate="12/10/2009";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 3 ))
{
texteng = "On these dates there is a minimum booking requirement of 3 nights.";
textspan = "En estas fechas el mínimo de noches es 3";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// NOVEMBER
//hsdate="30/10/2009";
//hedate="1/11/2009";
//overlap(ss,dz,hsdate,hedate)
//if (hold > 0 ) {nodis=15 }
//if (hold > 0 && (dz < 3 ))
//{
//texteng = "On these dates there is a minimum booking requirement of 3 nights.";
//textspan = "En estas fechas el mínimo de noches es 3";
//
//if (lang == "eng")
//{text = texteng}
//if (lang == "span")
//{text = textspan}
//
//window.alert(text)
//return false;
//}



// PUENTE INMAC MIN 3
hsdate="4/12/2009";
hedate="7/12/2009";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el minimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// CHRISTMAS MIN 5
hsdate="30/12/2009";
hedate="3/1/2010";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el minimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

//2010 2010 2010 2010 2010 2010 


// SEMANA SANTA MIN 5
hsdate="29/3/2010";
hedate="4/4/2010";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el minimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// PUENTE DE MAYO MIN 3
hsdate="30/4/2010";
hedate="2/5/2010";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 2 ))
{
texteng = "On these dates there is a minimum booking requirement of 2 nights.";
textspan = "En estas fechas el mínimo de noches es 2";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// OCTOBER
hsdate="9/10/2010";
hedate="12/10/2010";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 3 ))
{
texteng = "On these dates there is a minimum booking requirement of 3 nights.";
textspan = "En estas fechas el mínimo de noches es 3";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// NOVEMBER
hsdate="30/10/2010";
hedate="1/11/2010";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 3 ))
{
texteng = "On these dates there is a minimum booking requirement of 3 nights.";
textspan = "En estas fechas el mínimo de noches es 3";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}



// PUENTE INMAC MIN 3
hsdate="4/12/2010";
hedate="7/12/2010";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el minimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// CHRISTMAS MIN 5
hsdate="30/12/2010";
hedate="3/1/2011";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el minimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

//2011 2011 2011 2011 2011 2011 

// SEMANA SANTA MIN 5
hsdate="16/4/2011";
hedate="24/4/2011";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 5 ))
{
texteng = "On these dates there is a minimum booking requirement of 5 nights.";
textspan = "En estas fechas el minimo de noches es 5";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// PUENTE DE MAYO MIN 3
hsdate="1/5/2011";
hedate="3/5/2011";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 3 ))
{
texteng = "On these dates there is a minimum booking requirement of 3 nights.";
textspan = "En estas fechas el mínimo de noches es 3";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// OCTOBER
hsdate="9/10/2011";
hedate="12/10/2011";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el mínimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// NOVEMBER
hsdate="30/10/2011";
hedate="1/11/2011";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 3 ))
{
texteng = "On these dates there is a minimum booking requirement of 3 nights.";
textspan = "En estas fechas el mínimo de noches es 3";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}



// PUENTE INMAC MIN 3
hsdate="4/12/2011";
hedate="7/12/2011";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el minimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}

// CHRISTMAS MIN 5
hsdate="30/12/2011";
hedate="3/1/2012";
overlap(ss,dz,hsdate,hedate)
if (hold > 0 ) {nodis=15 }
if (hold > 0 && (dz < 4 ))
{
texteng = "On these dates there is a minimum booking requirement of 4 nights.";
textspan = "En estas fechas el minimo de noches es 4";

if (lang == "eng")
{text = texteng}
if (lang == "span")
{text = textspan}

window.alert(text)
return false;
}


return nodis
}




////////////////////////////////////////////////////////////////

function discount_calc(dz,ss)
{

//DISCOUNT CALCULATIONS

//SPECIAL DISCOUNT DATES
disc_num = 0; 

//NOVEMBER DISCOUNTS

start = "1/11/2007"
finish = "30/11/2007"

period = sf(start,finish)
start_discount = period[0] 
end_discount = period[1]
disc = dis(ss,start_discount,end_discount);
disc_num = (disc_num + disc) ; 
//END 


//DECEMBER DISCOUNTS

start = "9/12/2007"
finish = "19/12/2007"

period = sf(start,finish)
start_discount = period[0] 
end_discount = period[1]
disc = dis(ss,start_discount,end_discount);
disc_num = (disc_num + disc) ; 
//END 


//JAN AND FEB DISCOUNTS

start = "8/1/2008"
finish = "25/2/2008"

period = sf(start,finish)
start_discount = period[0] 
end_discount = period[1]
disc = dis(ss,start_discount,end_discount);
disc_num = (disc_num + disc) ; 
//END 


//JUNE JULY DISCOUNTS

start = "1/6/2008"
finish = "31/7/2008"

period = sf(start,finish)
start_discount = period[0] 
end_discount = period[1]
disc = dis(ss,start_discount,end_discount);
disc_num = (disc_num + disc) ; 
//END 


if (disc_num > 0) 
{disc_txt = "DIS";}
//END SPECIAL discOUNT DATES

return disc_txt;
}


//FUNCTION USED BY ABOVE FUNCTION

function dis(ss,start_discount,end_discount)
{
disc=0;
if ( (start_discount <= ss  ) && ( ss <= end_discount  ) ) 
{
disc = 1*1;
}

return disc;
}

//START AND FINISH

function sf(start,finish)
{
var dateArray = start.split('/');
start = new Date(dateArray[2],dateArray[1]-1,dateArray[0]);
start = start.getTime();

var dateArray = finish.split('/');
finish = new Date(dateArray[2],dateArray[1]-1,dateArray[0]);
finish = finish.getTime();

var period=new Array()

period[0]=start
period[1]=finish

return period;
}




