// JavaScript Document
function hideTabs(tab) {
document.getElementById("schools_teachers_trade").src="assets/images/schools_teachers_trade_inactive.jpg";
document.getElementById("parents_retail").src="assets/images/parents_retail_inactive.jpg";
document.getElementById("tutors_retail").src="assets/images/tutors_retail_inactive.jpg";
document.getElementById("home_sch_retail").src="assets/images/home_sch_retail_inactive.jpg";
document.getElementById("adult_learn_retail").src="assets/images/adult_learn_retail_inactive.jpg";
document.getElementById("bookshops_trade").src="assets/images/bookshops_trade_inactive.jpg";
tab.src="assets/images/"+tab.id+"_active.jpg";
}
function activateTabs(tab) {
	document.getElementById(tab).src="assets/images/"+tab+"_active.jpg";
}
function f_change_interest()
{
	if(document.getElementById('all_subjects').checked == true)
	{
		for(i=1;i<=length;i++)
			document.getElementById('client_interest['+[vector[i]]+']').checked = true;
	}
}
function f_reset_interest()
{
	document.getElementById('all_subjects').checked = false;
}
function f_change_interest_retail()
{
	if(document.getElementById('all_subjects_retail').checked == true)
	{
		for(i=1;i<=length;i++)
			document.getElementById('client_interest_retail['+[vector[i]]+']').checked = true;
	}
}
function f_reset_interest_retail()
{
	document.getElementById('all_subjects_retail').checked = false;
}
function showHide()
	{
		if(document.getElementById('client_hear_about_us').value==5)
		{
			document.getElementById('divshow').style.display='inline';
		} 
		else if(document.getElementById('client_hear_about_us').value!=5)
		{
			document.getElementById('divshow').style.display='none';
		}

	}
function showD()
	{
		if(document.getElementById('client_hear_about_us2').value==5)
		{
			document.getElementById('divShowd2').style.display='inline';
		} 
		else if(document.getElementById('client_hear_about_us2').value!=5)
		{
			document.getElementById('divShowd2').style.display='none';
		}

	}

function strpos(str, ch) {
for (var i = 0; i < str.length; i++)
if (str.substring(i, i+1) == ch) return i;
return -1;
}
function validateTrade(frm) {
	var title = frm.title;
	var mail = frm.emailAddress;
	var name = frm.firstName;
	var surname = frm.surname;
	var phone = frm.telephone;
	var jobTitle = frm.jobTitle;
	var school = frm.school;
	var username = frm.userName;
	var addressLine1 = frm.tiaddressLine1;
	var city = frm.ticity;
	var county = frm.ticounty;
	var postalCode = frm.tipostalCode;
	var country = frm.ticountry;
	
	var daddressLine1 = frm.tdaddressLine1;
	var dcity = frm.tdcity;
	var dcounty = frm.tdcounty;
	var dpostalCode = frm.tdpostalCode;
	var dcountry = frm.tdcountry;
	
	var password = frm.password;
	var passwordRetype = frm.passwordRetype;
	var rePhoneNumber = /[0-9|\+|\.|-|\s|\(|\)]{5,30}/;
	var emailFilter=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;
	if (frm.terms.checked== false) {
			alert('Please read Privacy policy!');
			title.focus();
		return false;
	}
/*	if (title.value.length<2){
			alert('Please select/type in yout title.');
			title.focus();
		return false;
	}*/
	if (name.value.length<2){
			alert('Please type in your first name. Minimum 2 characters required.');
			name.focus();
		return false;
	}
	if (surname.value.length<2){
			alert('Please type in your surname. Minimum 2 characters required.');
			surname.focus()
		return false;
	}
/*	if (school.value.length<2){
			alert('Please type in your School/Company name. Minimum 2 characters required.');
			school.focus();
		return false;
	}*/
	if (jobTitle.value.length<2){
			alert('Please type in your position/job title. Minimum 2 characters required.');
			jobTitle.focus();
		return false;
	}
	if (!(rePhoneNumber.test(phone.value))){
			alert('Please type in telephone number, at least 10 numbers.');
			phone.focus();
		return false;
	}
	if (!(emailFilter.test(mail.value))){
			alert('Please type in your valid email address.');
			mail.focus();
		return false;
	}
	if (username.value.length<3){
			alert('Your user name should consist of 3 or more characters and can be a combination of letters and/or numbers.');
			username.focus();
		return false;
	}
	
	if (password.value.length<3){
			alert('Your password should consist of 3 or more characters and can be a combination of letters and/or numbers.');
			password.focus();
		return false;
	}
	if (passwordRetype.value.length<3){
			alert('Please re-type your password.');
			passwordRetype.focus();
		return false;
	}
	if (password.value!=passwordRetype.value){
			alert('Password are different.');
			password.focus();
		return false;
	}
	if (dcity.value.length<3){
			alert('Please type in your delivery city.');
			dcity.focus();
		return false;
	} 

	if (dpostalCode.value.length<3){
			alert('Please type in your delivery postal code.');
			dpostalCode.focus();
		return false;
	} else {
		if (dcountry.value == '222' && strpos(dpostalCode.value, " ") == -1) {
			alert('Your delivery postal code is invalid. Postcodes must have a space in the middle, e.g. TN17 4ES.');
			dpostalCode.focus();
			return false;
		}
	}
	if (dcountry.selectedIndex==0){
			alert('Please type in your delivery country.');
			dcountry.focus();
		return false;
	}
	
	if (city.value.length<3){
			alert('Please type in your invoice city.');
			city.focus();
		return false;
	}
	if (postalCode.value.length<3){
			alert('Please type in your invoice postal code.');
			postalCode.focus();
		return false;
	} else {
		if (country.value == '222' && strpos(postalCode.value, " ") == -1) {
			alert('Your invoice postal code is invalid. Postcode must have a space in the middle, e.g. TN17 4ES.');
			postalCode.focus();
			return false;
		}
	}
	if (country.selectedIndex==0){
			alert('Please type in your invoice country.');
			country.focus();
		return false;
	}
	
	
	
	
} 

function validateRetail(frm) {
	var title2 = frm.title2;
	var mail2 = frm.emailAddress2;
	var name2 = frm.firstName2;
	var surname2 = frm.surname2;
	var phone2 = frm.telephone2;
	var username2 = frm.userName2;
	var addressLine12 = frm.riaddressLine12;
	var city2 = frm.ricity2;
	var county2 = frm.ricounty2;
	var country2 = frm.ricountry2;
	var postalCode2 = frm.ripostalCode2;
	var rePhoneNumber = /[0-9|\+|\.|-|\s|\(|\)]{5,30}/;
	
	var daddressLine12 = frm.rdaddressLine12;
	var dcity2 = frm.rdcity2;
	var dcounty2 = frm.rdcounty2;
	var dcountry2 = frm.rdcountry2;
	var dpostalCode2 = frm.rdpostalCode2;
	
	var password2 = frm.password2;
	var passwordRetype2 = frm.passwordRetype2;
	var emailFilter=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/;
	if (frm.terms.checked == false) {
			alert('Please read Privacy policy!');
		return false;
	}
/*	if (title2.value.length<2){
			alert('Please select/type in yout title.');
			title2.focus();
		return false;
	}*/
	if (name2.value.length<2){
			alert('Please type in your first name. Minimum 2 characters required.');
			name2.focus();
		return false;
	}
	if (surname2.value.length<2){
			alert('Please type in your surname. Minimum 2 characters required.');
			surname2.focus()
		return false;
	}
	if (!(rePhoneNumber.test(phone2.value))){
			alert('Please type in telephone number, at least 10 numbers.');
			phone2.focus();
		return false;
	}
	if (!(emailFilter.test(mail2.value))){
			alert('Please type in your valid email address.');
			mail2.focus();
		return false;
	}
	if (username2.value.length<3){
			alert('Your user name should consist of 3 or more characters and can be a combination of letters and/or numbers');
			username2.focus();
		return false;
	}
	
	if (password2.value.length<3){
			alert('Your password should consist of 3 or more characters and can be a combination of letters and/or numbers');
			password2.focus();
		return false;
	}
	if (passwordRetype2.value.length<3){
			alert('Please re-type your password.');
			passwordRetype2.focus();
		return false;
	}
	if (password2.value!=passwordRetype2.value){
			alert('Password are different.');
			password2.focus();
		return false;
	}
	if (daddressLine12.value.length<3){
			alert('Please type in your delivery address.');
			daddressLine12.focus();
		return false;
	}
	if (dcity2.value.length<3){
			alert('Please type in your delivery city.');
			dcity2.focus();
		return false;
	}

	if (dpostalCode2.value.length<3){
			alert('Please type in your delivery postal code.');
			dpostalCode2.focus();
		return false;
	} else {
		if (dcountry2.value == '222' && strpos(dpostalCode2.value, " ") == -1) {
			alert('Your delivery postal code is invalid. Postcodes must have a space in the middle, e.g. TN17 4ES.');
			return false;
		}
	}
	if (dcountry2.selectedIndex==0){
			alert('Please type in your delivery country.');
			dcountry2.focus();
		return false;
	}
	if (addressLine12.value.length<3){
			alert('Please type in your invoice address.');
			addressLine12.focus();
		return false;
	}
	if (city2.value.length<3){
			alert('Please type in your invoice city.');
			city2.focus();
		return false;
	}

	if (postalCode2.value.length<3){
			alert('Please type in your invoice postal code.');
			postalCode2.focus();
		return false;
	} else {
		if (country2.value == '222' && strpos(postalCode2.value, " ") == -1) {
			alert('Your invoice postal code is invalid. Postcode must have a space in the middle, e.g. TN17 4ES.');
			postalCode2.focus();
			return false;
		}
	}
	if (country2.selectedIndex==0){
		alert('Please type in your invoice country.');
		country2.focus();
	return false;
	}
	
	
} 

function invoiceTrade(frm) {
	var iaddressLine1 = frm.tiaddressLine1;
	var iaddressLine2 = frm.tiaddressLine2;
	var ticity = frm.ticity;
	var ticounty = frm.ticounty
	var tipostalCode = frm.tipostalCode;
	var ticountry = frm.ticountry;
	var daddressLine1 = frm.tdaddressLine1;
	var daddressLine2 = frm.tdaddressLine2;
	var tdcity = frm.tdcity;
	var tdcounty = frm.tdcounty;
	var tdpostalCode = frm.tdpostalCode;
	var tdcountry = frm.tdcountry;
	
	iaddressLine1.value = daddressLine1.value;
	iaddressLine2.value = daddressLine2.value;
	ticity.value = tdcity.value;
	ticounty.value = tdcounty.value;
	tipostalCode.value = tdpostalCode.value;
	ticountry.selectedIndex = tdcountry.selectedIndex;
		
}

function invoiceRetail(frm) {
	var iaddressLine12 = frm.riaddressLine12;
	var iaddressLine22 = frm.riaddressLine22;
	var icity2 = frm.ricity2;
	var icounty2 = frm.ricounty2;
	var ipostalCode2 = frm.ripostalCode2;
	var icountry2 = frm.ricountry2;
	var daddressLine12 = frm.rdaddressLine12;
	var daddressLine22 = frm.rdaddressLine22;
	var dcity2 = frm.rdcity2;
	var dcounty2 = frm.rdcounty2;
	var dpostalCode2 = frm.rdpostalCode2;
	var dcountry2 = frm.rdcountry2;
	
	iaddressLine12.value = daddressLine12.value;
	iaddressLine22.value = daddressLine22.value;
	icity2.value = dcity2.value;
	icounty2.value = dcounty2.value;
	ipostalCode2.value = dpostalCode2.value;
	icountry2.selectedIndex = dcountry2.selectedIndex;
		
}

var ALERT_TITLE = "Please select account type!";
var ALERT_BUTTON_TEXT = "Ok";

function createCustomAlert_ip() {
	// shortcut reference to the document object
	d = document;

	// if the modalContainer object already exists in the DOM, bail out.
	if(d.getElementById("modalContainer")) return;

	// create the modalContainer div as a child of the BODY element
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	 // make sure its as tall as it needs to be to overlay all the content on the page
	mObj.style.height = document.documentElement.scrollHeight + "px";

	// create the DIV that will be the alert 
	alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "alertBox";
	// MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
	if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
	// center the alert box
	alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";

	// create an H1 element as the title bar
	h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode('Outside United Kingdom'));

	// create a paragraph element to contain the txt argument
	msg = alertObj.appendChild(d.createElement("p"));
	msg.innerHTML = "Dear Visitor,<br><br>We have noticed that you are accessing our site from outside the UK. Please select the version of our site that you wish to see:";
	div = alertObj.appendChild(d.createElement("div"));
 	 div.innerHTML = "<br><input type='radio' name='overseat' checked='checked' id='international' value='yes' /><label for='international'>International version</label><br><input type='radio' name='overseat' value='no' id='uk' /><label for='uk'>UK version</label>";


	// create an anchor element to use as the confirmation button.
	btn = alertObj.appendChild(d.createElement("a"));
	btn.id = "closeBtn";
	btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
	btn.href = "#";
	// set up the onclick event to remove the alert when the anchor is clicked
	btn.onclick = function() {
		if (document.getElementById('uk') && document.getElementById('uk').checked) {
			createCookie('international','0',365);
//			document.location.href = 'http://galorepark.co.uk/uk';
			window.location.reload()
			removeCustomAlert_ip();
		}
		if (document.getElementById('international') && document.getElementById('international').checked) {
			createCookie('international','1',365);
			window.location.reload();
//			document.location.href = 'http://galorepark.co.uk/international';
			removeCustomAlert_ip();
		}
		
		return false;  // removeCustomAlert();
	}

	
}

// removes the custom alert from the DOM
function removeCustomAlert_ip() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}


function whitelabelCustomAlert_ip(whitelabel) {
    // shortcut reference to the document object
    d = document;

    // if the modalContainer object already exists in the DOM, bail out.
    if(d.getElementById("modalContainer")) return;

    // create the modalContainer div as a child of the BODY element
    mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
    mObj.id = "modalContainer";
     // make sure its as tall as it needs to be to overlay all the content on the page
    mObj.style.height = document.documentElement.scrollHeight + "px";

    // create the DIV that will be the alert 
    alertObj = mObj.appendChild(d.createElement("div"));
    alertObj.id = "alertBox";
    // MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
    if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
    // center the alert box
    alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";

    // create an H1 element as the title bar
    h1 = alertObj.appendChild(d.createElement("h1"));
    h1.appendChild(d.createTextNode('Notice'));

    // create a paragraph element to contain the txt argument
    msg = alertObj.appendChild(d.createElement("p"));
    msg.innerHTML = "<br>Register today to support your child's learning at home. If you have already registered, please click close.";
    div = alertObj.appendChild(d.createElement("div"));
      //div.innerHTML = "<br><input type='radio' name='subscribe' checked='checked' id='yes' value='yes' /><label for='yes'>Yes</label><br><input type='radio' name='subscribe' value='no' id='no' /><label for='no'>No</label>";
    div.innerHTML = "<br> <div style='padding-left:30px;'><a href='/whitelabel_newsletter.php' id='closeBtn' style='float:left;font:1.3em verdana,arial;'>Register</a> <a href='javascript:removewhitelabelCustomAlert_ip();' id='closeBtn'style='font:1.3em verdana,arial;float:left;font:1.0 em;margin-left:20px;'>Close</a></div>"
    /*
    // create an anchor element to use as the confirmation button.
    btn = alertObj.appendChild(d.createElement("a"));
    btn.id = "closeBtn";
    btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
    btn.href = "#";
    
    // create an anchor element to use as the confirmation button.
    btn = alertObj.appendChild(d.createElement("a"));
    btn.id = "closeBtn";
    btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
    btn.href = "#";     */
    // set up the onclick event to remove the alert when the anchor is clicked
    /*
    btn.onclick = function() {
        if (document.getElementById('yes') && document.getElementById('yes').checked) {

            window.location = 'http://'+ whitelabel + '.galorepark.co.uk/whitelabel_newsletter.php'
            removewhitelabelCustomAlert_ip();
        }
        if (document.getElementById('no') && document.getElementById('no').checked) {
        
            window.location = 'http://'+ whitelabel + '.galorepark.co.uk/'  
            removewhitelabelCustomAlert_ip();
        }
        
        return false;  // removeCustomAlert();
    }
    */
    
}

// removes the custom alert from the DOM
function removewhitelabelCustomAlert_ip() {
    document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}


function createCustomAlert_free_demo(file) {
	// shortcut reference to the document object
	d = document;

	// if the modalContainer object already exists in the DOM, bail out.
	if(d.getElementById("modalContainer")) return;

	// create the modalContainer div as a child of the BODY element
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	 // make sure its as tall as it needs to be to overlay all the content on the page
	mObj.style.height = document.documentElement.scrollHeight + "px";

	// create the DIV that will be the alert 
	alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "alertBox1";
	// MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
	if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px";
	// center the alert box
	alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";

	// create an H1 element as the title bar
	h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode('Require Promethean Activprimary'));

	// create a paragraph element to contain the txt argument
	msg = alertObj.appendChild(d.createElement("p"));
	msg.innerHTML = "Please note that this demo requires Promethean Activprimary, Activstudio or ActivInspire to be installed in order to run. If you do not have Promethean software available in your school, download and install the free version of ActivInspire from the Promethean website.";
	div = alertObj.appendChild(d.createElement("div"));
 	 div.innerHTML = "<br><input type='radio' name='option' checked='checked' id='continue' value='continue' /><label for='continue'> Continue.  I already have Promethean software installed.</label><br><input type='radio' name='option' value='link' id='link' /><label for='link'> Visit the Promethean website now to download the Promethean software.</label><br><input type='radio' name='option' value='cancel' id='cancel' /><label for='cancel'> Cancel</label>";


	// create an anchor element to use as the confirmation button.
	btn = alertObj.appendChild(d.createElement("a"));
	btn.id = "closeBtn";
	btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
//	btn.href = "#";
	// set up the onclick event to remove the alert when the anchor is clicked
	btn.onclick = function() {
		if (document.getElementById('continue') && document.getElementById('continue').checked) {
			//document.location.href = file;
			window.open(file,"_blank");
			removeCustomAlert_free_demo();
		}
		if (document.getElementById('link') && document.getElementById('link').checked) {
			window.open('http://www.prometheanworld.com/',"_blank");
			removeCustomAlert_free_demo();
		}
		
		if (document.getElementById('cancel') && document.getElementById('cancel').checked) {
			removeCustomAlert_free_demo();
		}
		
		return false;  // removeCustomAlert();
	}

	
}

// removes the custom alert from the DOM
function removeCustomAlert_free_demo() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}

function customAlert($message) {
	// shortcut reference to the document object
	d = document;

	// if the modalContainer object already exists in the DOM, bail out.
	if(d.getElementById("modalContainer")) return;

	// create the modalContainer div as a child of the BODY element
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	 // make sure its as tall as it needs to be to overlay all the content on the page
	mObj.style.height = document.documentElement.scrollHeight + "px";

	// create the DIV that will be the alert 
	alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "alertBox";
	// MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
	if(d.all && !window.opera) alertObj.style.top = "100px";
	// center the alert box
	alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px";

	// create an H1 element as the title bar
	h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode('Delivery Information'));

	// create a paragraph element to contain the txt argument
	msg = alertObj.appendChild(d.createElement("p"));
	msg.innerHTML = $message;
//	div = alertObj.appendChild(d.createElement("div"));
// 	 div.innerHTML = "<br><input type='radio' name='overseat' checked='checked' id='international' value='yes' /><label for='international'>International version</label><br><input type='radio' name='overseat' value='no' id='uk' /><label for='uk'>UK version</label>";


	// create an anchor element to use as the confirmation button.
	btn = alertObj.appendChild(d.createElement("a"));
	btn.id = "closeBtn";
	btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
	btn.href = "#";
	// set up the onclick event to remove the alert when the anchor is clicked
	btn.onclick = function() {
			removeCustomAlert();
		
		return false;  // removeCustomAlert();
	}

	
}

// removes the custom alert from the DOM
function removeCustomAlert() {
	document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer"));
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


//Get youTube thumbnail by url
function getScreen( url, size, renderMode, options )
{
	size = size || 'small';
	renderMode = renderMode || 'url';
	options = options || {};
  if(url === null){ return ""; }

  size = (size === null) ? "big" : size;
  var vid;
  var results;
  var returnUrl;
  results = url.match("[a-z.//:]*\/v\/([^&#]*)");

  vid = ( results === null ) ? url : results[1];

  if(size == "small"){
	  returnUrl = "http://img.youtube.com/vi/"+vid+"/2.jpg";
  }else {
	  returnUrl = "http://img.youtube.com/vi/"+vid+"/0.jpg";
  }
  
  switch(renderMode){
  	case 'url':
  		return returnUrl;
	break;

  	case 'image':
  		return '<img src="'+returnUrl+'" class="youtube_thumb" style="'+options.style+'" />';
	break;
	
  	case 'thumb':
  		return "<img src='"+returnUrl+"' class='youtube_thumb' style='cursor:pointer; "+options.style+"' onclick='youtubePopup(\""+url+"\", "+options.toSource()+")' />";
	break;
	
  }  
}



Object.prototype.mergeObj = function(destination,source) {
    for (var property in source)
        destination[property] = source[property];
    return destination;
}


function youtubePopup(url, outOptions) {
	outOptions = outOptions || false;
	options = {
		width: 480,
		height: 385,
		title: 'Video preview'
	};
	if(outOptions!=false){
		options = options.mergeObj(options, outOptions);
	}
	// shortcut reference to the document object
	d = document;

	// if the modalContainer object already exists in the DOM, bail out.
	if(d.getElementById("modalContainer")) return;

	// create the modalContainer div as a child of the BODY element
	mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div"));
	mObj.id = "modalContainer";
	 // make sure its as tall as it needs to be to overlay all the content on the page
	mObj.style.height = document.documentElement.scrollHeight + "px";

	// create the DIV that will be the alert 
	alertObj = mObj.appendChild(d.createElement("div"));
	alertObj.id = "videoBox";
	// MSIE doesnt treat position:fixed correctly, so this compensates for positioning the alert
	if(d.all && !window.opera) alertObj.style.top = "100px";
	// center the alert box
	alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/3 + "px";

	// create an H1 element as the title bar
	h1 = alertObj.appendChild(d.createElement("h1"));
	h1.appendChild(d.createTextNode(options.title));

	// create a paragraph element to contain the txt argument
	msg = alertObj.appendChild(d.createElement("p"));

	msg.innerHTML = '<object width="'+options.width+'" height="'+options.height+'"><param value="'+url+'" name="movie"><param value="true" name="allowFullScreen"><param value="always" name="allowscriptaccess"><embed width="'+options.width+'" height="'+options.height+'" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="'+url+'"></object>';

	// create an anchor element to use as the confirmation button.
	btn = alertObj.appendChild(d.createElement("a"));
	btn.id = "closeBtn";
	btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));
	btn.href = "#";
	// set up the onclick event to remove the alert when the anchor is clicked
	btn.onclick = function() {
			removeCustomAlert();
		
		return false;  // removeCustomAlert();
	}	
}

