// JavaScript Document

function clearBoxes()
{
	document.form1.testinput.value="";
	document.form1.testid.value="";
	document.form1.add_id.value="";
	document.form1.add3.value="";
	document.form1.add5.value="";
	document.form1.testinput.focus();
}



function get_addy_regional() {	
var req;

var w = document.form1.hub.selectedIndex;
var selected_text = document.form1.hub.options[w].text;
var div = document.getElementById('suburb_list');

alert(selected_text); 

	req = null;
	  
	if (window.XMLHttpRequest) {req = new XMLHttpRequest();}else if (window.ActiveXObject) {req = new ActiveXObject("Microsoft.XMLHTTP");}
		  
	req.open("POST", "/za/ajax_regionals.php?var="+selected_text, false);
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	req.send(null);
	div.innerHTML = req.responseText;
	togglemenushow('suburb_row');
	return req;	
}

function tshirts(clr, pic){
document.getElementById('clrshirt').innerHTML = '<img src="/za/php/rapidstudio/products/tshirts/images/'+pic+'_upload_'+clr+'.png" width="285" height="190" id="clrshirt" />';
}

function rapidstudiodownload(labcode, campaign) {
			var labcode= labcode;
			msg=window.open("php/rapidstudio/downloads/index.php?labcode="+labcode+"&campaignid="+campaign+"","","height=500,width=500,left=10,top=10 scrollbars=auto");
		}
	
function opendiv(type, page){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_'+type);
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
	thediv_Foreground.style.display = "";
	thediv_Background.style.display = "";
	thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='"+page+"'></iframe></td></tr></table>";
	}
	else
	{
	thediv_Foreground.style.display = "none";
	thediv_Background.style.display = "none";
	}
	return false;
}

function checkdeliverySelected(){
	var cell = document.getElementById('updatecell').value;
	var username = document.getElementById('username').value;
	var userid = document.getElementById('userid').value;
	//var email_verify = document.getElementById('email_verify').value;
	//var email_verify_code = document.getElementById('email_verify_code').value;
	if (document.getElementById('did_modify').value == '1' || document.getElementById('checkdelivery').value == '0' || cell == 'Please update your cellphone number!' || cell == '' || cell == ' ' || username == '' || username == ' ')
	{
		////  || email_verify == '1' && email_verify_code == '' || email_verify == '1' && email_verify_code == ' '
		//if (email_verify == '1' && email_verify_code == '' || email_verify == '1' && email_verify_code == ' ')
		//alert('Please enter you email verification code!');
		if (cell == 'Please update your cellphone number!' || cell == '' || cell == ' ')
		alert('Please enter a valid cellphone number!');
		else if (username == ' ' || username == '')
		opendiv('Friends', 'php/rapidstudio/members/updatename.php?div=Friends&id='+userid);
		else if (document.getElementById('did_modify').value == 1)
		alert('Your quantities have changed!\nPlease click on the "ALTER" button before you Checkout');			
		else if (document.getElementById('checkdelivery').value == 0)
		alert('Please select your delivery options!');
				
		return false;	
	}
}

function closefriendaddressupdate(invid, which) {
top.document.location = '/za/?p=5319cd0c393f569de0752376936b6233&invid='+invid+'&postage=us&which='+which;			
}

function closeSpecificPage(which) {
top.document.location = which;			
}

function clickerEmailPreview(type, id, heading, userid){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Competition_New');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/invites/emailpreview.php?id="+id+"&type="+type+"&heading="+heading+"&userid="+userid+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickeSWCPreview(){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Competition_New');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/calendars/swc/preview.php?p=1'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerEditFAQ(id){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Friends');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/editfaq.php?id="+id+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function previewOrder(id, wt){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/share/preview.php?id="+id+"&wt="+wt+"&page=0'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function addfriendsaddress(id, invid, which){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Friends');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/members/add_friends_address.php?userid="+id+"&invid="+invid+"&which="+which+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function checkEmailSMS(){
	var emaildate = document.getElementById('dateEmail').value;
	var emailrecipients = document.getElementById('emailrecipients').value;
	var emailsubject = document.getElementById('emailsubject').value;
	var emailbody = document.getElementById('emailbody').value;
	var emailfrom = document.getElementById('emailfrom').value;
	
	if(emaildate == '')
	emaildateTXT = '- Date to send the emails.\n';
	else
	emaildateTXT = '';
	
	if(emailrecipients == '' || emailrecipients == 'Type recipient email addresses here, separated by commas.')
	emailrecipientsTXT = '- Enter at least one recipient.\n';
	else
	emailrecipientsTXT = '';

	if(emailsubject == '')
	emailsubjectTXT = '- A subject for your emails.\n';
	else
	emailsubjectTXT = '';
	
	if(emailbody == '')
	emailbodyTXT = '- Content for your emails.\n';
	else
	emailbodyTXT = '';
	
	if(emailfrom == '')
	emailfromTXT = '- Who the emails will be from.\n';
	else
	emailfromTXT = '';
	
/////////sms
	var dateSMS = document.getElementById('dateSMS').value;
	var smsbody = document.getElementById('smsbody').value;

	myOption = -1;
	for (i=formemail.smscheck.length-1; i > -1; i--) 
	{
		if (formemail.smscheck[i].checked) 
		{
		myOption = i; 
		i = -1;
		}
	}
	
	if (formemail.smscheck[myOption].value == 'yes')
	{
		if(dateSMS == '')
		dateSMSTXT = '- Date of your event (SMS).\n';
		else
		dateSMSTXT = '';
		
		if(smsbody == '')
		smsbodyTXT = '- Content for your SMS.\n';
		else
		smsbodyTXT = '';
	}
	else
	{
	dateSMSTXT = '';
	smsbodyTXT = '';
	}
	
	if (emaildate == '' || emailrecipients == '' || emailrecipients == 'Type recipient email addresses here, separated by commas.' || emailsubject == '' || emailbody == '' || emailfrom == '' || formemail.smscheck[myOption].value == 'yes' && dateSMS == '' || formemail.smscheck[myOption].value == 'yes' && smsbody == '')
	{
	alert('Please check the following fields:\n'+emaildateTXT+emailrecipientsTXT+emailsubjectTXT+emailbodyTXT+emailfromTXT+dateSMSTXT+smsbodyTXT);
	return false;
	}
	else
	{
		return true;
	}
}

function clickerAddFriends(whichbox, userid, type, emailid){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=document.getElementById('displaybox_Background');
	var emaildate =document.getElementById('dateEmail').value;
	var smsdate =document.getElementById('dateSMS').value;
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/choosefriends.php?whichbox="+whichbox+"&userid="+userid+"&type="+type+"&emailid="+emailid+"&emaildate="+emaildate+"&smsdate="+smsdate+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function closeaddemail(invid, emailid, emaildate, smsdate) {
top.document.location = '/za/?p=8deccb9b6319f53e2e0bf17af3a197ef&invid='+invid+'&emailid='+emailid+'&emaildate='+emaildate+'&smsdate='+smsdate;			
}

function closeclickerFriends(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Friends');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function updatefriendsAddress(id, invid, which, warning){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Friends');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/members/update_friends_address.php?id="+id+"&invid="+invid+"&which="+which+"&warning="+warning+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function updateprojectname(name){
	top.document.getElementById('jobname').value = name;
	top.document.orderform.submit();
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		
		
}

function choosedelivery(page, type){
top.document.location = page+""+type+"&page=1&search=1&add=Johannesburg";	
}


function make_blankO()
{
document.reorder.orderno.value ="";
document.reorder.cell.value ="Please enter your cell number!";
document.reorder.check.value ="order";
}


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID");
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID");
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID");
		    return false;
		 }

 		 return true	;				
	}


function quickregister(){
	joinlogin();
	var email = document.getElementById('email').value;	
	var password = document.getElementById('password').value;
	var passwordconfirm = document.getElementById('password_confirm').value;
	var terms = document.getElementById('tc').length;
		
	if (email == '' && password  == '')
	{
		alert('Please enter your email address and a password to use!');
		return false;
	}
	else if (email == '')
	{
		alert('Please enter your email address!');
		return false;
	}
	else if (password == '')
	{
		alert('Please enter a password!');
		return false;
	}
	
	
	if (password !== passwordconfirm)
	{
		alert('Your passwords to not match. Please re-enter your passwords!');
		return false;
	}
	
	if (document.getElementById('tc').checked !== true)
	{
		alert('Please read our terms and conditions.');
		return false;
	}	
}

function updatenamecheck(){
	var name = document.getElementById('name').value;	
	var surname = document.getElementById('surname').value;
		
	if (name == '' && surname  == '')
	{
		alert('Please enter your name and surname!');
		return false;
	}
	else if (name == '' || name == ' ')
	{
		alert('Please enter your name!');
		return false;
	}
	else if (surname == '' || surname == ' ')
	{
		alert('Please enter your surname!');
		return false;
	}
}

function disp_text()
   {
   var w = document.form1.banks.selectedIndex;
   var selected_text = document.form1.banks.options[w].text;
   if (selected_text == 'ABSA' || selected_text == 'Nedbank' || selected_text == 'Standard Bank')
	{
		togglemenuhide('other');
		var msg = 'Please allow 2-3 working days before it appears in our bank account!';   
	}
   else if (selected_text == 'Other')
	{
		togglemenushow('other');
		var msg = 'Please allow 2-5 working days before it appears in our bank account!';   
		document.form1.otherbank.focus();
	}
	else if (selected_text == 'First National Bank')
	{
		togglemenuhide('other');
		var msg = 'We will be able to confirm payment as soon as possible!';   
	}
	else if (selected_text == 'Please select your bank')
	{
		togglemenuhide('other');
		var msg = 'Please select your bank!';   
	}
   else
   	{
		togglemenuhide('other');
		var msg = 'We will be able to confirm payment as soon as possible!';  
	}
	
	document.getElementById('delay').innerHTML=msg;
   
}

function checkBypass()
   {
   var w = document.form1.banks.selectedIndex;
   var selected_text = document.form1.banks.options[w].text;
  	if (selected_text == 'Please select your bank')
	{
		alert('Please select a valid baking institution!')  
		return false;
	}   
}

function checkReprint()
   {
   var password = document.getElementById('password').value;
   var reason = document.getElementById('reason').value;

  	if (password == '' || password == ' ')
	{
		alert('Please enter a valid password!')  
		return false;
	}
	
	if (reason == '' || reason == ' ')
	{
		alert('Please enter a reason!')  
		return false;
	}
}
   
function formCheck(formobj){
	// name of mandatory fields
var fieldRequired = Array("username","password");
	// field description to appear in the dialog box
	var fieldDescription = Array("Username", "Password");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			if (obj.type == null){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				continue;
			}

			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
		}
	}

	if (alertMsg.length == l_Msg){
		
	}else{
		alert(alertMsg);
		return false;
	}

}

function formCheckJoin(formobj){
	// name of mandatory fields
var fieldRequired = Array("company","deladd2","deladd3","deladd4","deladd5","name","surname","email","bday","bmonth", "title");
	// field description to appear in the dialog box
	var fieldDescription = Array("Company name", "Street name", "Suburb", "City", "Zip Code", "Your Name", "Your Surname", "Your Email", "Your Birthday", "Your Birthmonth", "Title");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			if (obj.type == null){
				var blnchecked = false;
				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				continue;
			}

			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == ""){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
		}
	}

	if (alertMsg.length == l_Msg){
		
	}else{
		alert(alertMsg);
		return false;
	}

}


function newaddresscheck(){
myOption = -1;
for (i=form1.newaddress.length-1; i > -1; i--) 
{
	if (form1.newaddress[i].checked) 
	{
	myOption = i; 
	i = -1;
	}
}

if (form1.newaddress[myOption].value == 'new')
{
	var add1check = document.getElementById('add1').value;
	var add2check = document.getElementById('testinput').value;
	var add3check = document.getElementById('add5').value;
	
	add1check = add1check.replace(" ","");
	add2check = add2check.replace(" ","");
	add3check = add3check.replace(" ","");

	if (add1check == '' || add2check == '' || add3check == '')
	{
		alert('Please complete your delivery address details!');
		return false;
	}
}
}

function make_blankRefer()
{
document.getElementById('recipients').value ="";
}

function make_blankC()
{
document.reorder.cell.value ="";
document.reorder.orderno.value ="Please enter your orderno!";
document.reorder.check.value ="cell";
}

function checkreorder(){

	if (document.reorder.cell.value.length < 7 || document.reorder.orderno.value.length < 7 )
	{
	alert('You need to enter more than 6 characters');
	return false;
	}
	else
	{ 
		if (document.reorder.cell.value == '' && document.reorder.check.value == 'cell' || document.reorder.cell.value == 'Please enter your cell number!' && document.reorder.check.value == 'cell' )
		{
		alert('Please enter your cellphone number');
		return false;
		}
		else if (document.reorder.orderno.value == '' && document.reorder.check.value == 'order' || document.reorder.orderno.value == 'Please enter your orderno!' && document.reorder.check.value == 'order' )
		{
		alert('Please enter your order number');
		return false;
		}
	}
}

function runSlideShow(){
if (document.all){
document.images.PictureBox.style.filter="blendTrans(duration=2)";
document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
document.images.PictureBox.filters.blendTrans.Apply();}
document.images.PictureBox.src = preLoad[jss].src;
if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss]; document.getElementById("LinksBox").innerHTML= Links[jss];
if (document.all) document.images.PictureBox.filters.blendTrans.Play();
jss = jss + 1;
if (jss > (pss)) jss=1;
tss = setTimeout('runSlideShow()', SlideShowSpeed);
}


var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

function samplepopup(which) {
msg=window.open("/za/php/rapidstudio/sampledisplay.php?sample="+which+"&type=all","msg","height=800,width=950,left=80,top=80, scrollbars=yes");
}

function closeview(){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');

		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
}

function album_report_popup(orderno, page){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Sample');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	//alert('p');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='choosealbum' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/albums/_rapidstudio_album_report_previews/album_report_preview.php?orderno="+orderno+"&page="+page+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
	}
	return false;
}

function checkperscal(){
	if (document.getElementById('name').value == 'Name' || document.getElementById('surname').value == 'Surname' || document.getElementById('name').value == '' || document.getElementById('surname').value == '')
	{
	alert('Please enter a Name and a Surname!');
	return false;	
	}
	
}


function flipPersImage(colour) {
	var div=document.getElementById('preview');

	div.innerHTML = '<img src="/za/php/rapidstudio/products/personalisation/calendars/standard/images/a3-poster-calendar-'+colour+'.jpg" alt="" width="360" height="385" border="0" />';
	
	
	
}
function choosePers(userid, which, wt, calid, x, y, width, height, div, heading, date, imagename){

	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Sample');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	//alert('p');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='choosealbum' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/personalisation/chooseImage.php?heading="+heading+"&userid="+userid+"&p="+which+"&wt="+wt+"&calid="+calid+"&x="+x+"&y="+y+"&width="+width+"&height="+height+"&div="+div+"&date="+date+"&imagename="+imagename+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
	}
	return false;
}
function totalsgotPers(calid){
	req = null;
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/products/personalisation/calendars/standard/totalsAjax.php?calid="+calid+"&got=1", false);
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				  
	req.send(null);

	var div = top.document.getElementById('gottotals');
	div.value = req.responseText;
	
	totalsneedPers(calid, req.responseText);
}

function totalsneedPers(calid, gottotal){
	req = null;
				  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/products/calendars/standard/totalsAjax.php?calid="+calid+"&got=0", false);
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				  
	req.send(null);

	//var div = top.document.getElementById('needtotals');
	//div.value = req.responseText;

	if(req.responseText == gottotal)
	{
		top.document.getElementById('continuebutton').style.display = 'block';
	}
}
function closeclickercropCalendarsPers(heading, divname, wt, filename, img_width, img_height, date, calid){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Sample');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Photo=top.calendar_data.document.getElementById(divname);
	//updateFilename(filename, wt, date, calid, divname);
	
		showMonthSelectedImages(date, calid);
		totalsgotPers(calid);
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		
		thediv_Photo.innerHTML = "<img src='/za/php/rapidstudio/products/personalisation/sample_pics/"+filename+"' width='"+img_width+"' height='"+img_height+"' />";
}
function cleartxt(name) {
	document.getElementById(name).value = '';
}

function cleartxt_cell() {
	document.getElementById('updatecell').style.color = '#000000';
	document.getElementById('updatecell').value = '';
}

function minNumberInv(minimum,fieldname, discountValue, discountAmount)
      {		
		var rsvptext = top.document.getElementById('rsvptext').value;
		var rsvpdate = top.document.getElementById('rsvpdate').value;
		var rsvpaddress = top.document.getElementById('rsvpaddress').value;
		var rsvpname = top.document.getElementById('rsvpname').value;
		var rsvptel = top.document.getElementById('rsvptel').value;
		var rsvpemail = top.document.getElementById('rsvpemail').value;
		var rsvpbefore = top.document.getElementById('rsvpbefore').value;
		var greetingcardmessage = top.document.getElementById('greetingcardmessage').value;
		var pic = top.document.getElementById('imagename').value;
			if (greetingcardmessage == '' || greetingcardmessage == 'Type your message here' || pic == '' || rsvptext == '' || rsvpdate == '' || rsvpaddress == '' || rsvpname == '' || rsvptel == '' || rsvpemail == '' || rsvpbefore == '')
			{
				
				if (greetingcardmessage == '' || greetingcardmessage == 'Type your message here')
				{
				alert('Please complete your message for the inside right page');
				return false;
				}
				else if (rsvptext == '')
				{
				alert('Please complete your RSVP message');
				return false;
				}
				else if (rsvpdate == '')
				{
				alert('Please complete your date for the event');
				return false;
				}
				else if (rsvpaddress == '')
				{
				alert('Please enter the address where the event will be held');
				return false;
				}
				else if (rsvpname == '')
				{
				alert('Please enter the name of the person to contact');
				return false;
				}
				else if (rsvptel == '')
				{
				alert('Please enter a contact number for RSVP');
				return false;
				}
				else if (rsvpemail == '')
				{
				alert('Please enter an email address');
				return false;
				}
				else if (rsvpbefore == '')
				{
				alert('Please complete the RSVP date');
				return false;
				}
				else if (pic == '')
				{
				alert('Please choose an image for your outside page');
				return false;
				}
			}
			else
			{
				 var quantity = eval(document.getElementById(fieldname).value);
				 if (quantity < minimum)
				 {
					 alert('Sorry but the minimum order is '+minimum+'!');
					 document.getElementById(fieldname).value = minimum;
					 return false;
				 }
				 
				 /////////////////discount
				 if (quantity >= discountAmount)
				 {
					document.getElementById('discount').value = discountValue; 
				 }
				 
				 	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
					var thediv_Background=top.document.getElementById('displaybox_Background');
					if(thediv_Foreground.style.display == "none")
					{
						thediv_Foreground.style.display = "";
						thediv_Background.style.display = "";
						thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/nameit.php'></iframe></td></tr></table>";
					}
					else
					{
						thediv_Foreground.style.display = "none";
						thediv_Background.style.display = "none";
					}
					return false;
		 }

			
 
      }

function minNumber(minimum,fieldname, discountValue, discountAmount)
      {			
		 var quantity = eval(document.getElementById(fieldname).value);
		 if (quantity < minimum)
		 {
			 alert('Sorry but the minimum order is '+minimum+'!');
			 document.getElementById(fieldname).value = minimum;
			 return false;
		 }
		 
		 /////////////////discount
		 if (quantity >= discountAmount)
		 {
			document.getElementById('discount').value = discountValue; 
		 }
		 			var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
					var thediv_Background=top.document.getElementById('displaybox_Background');
					var jobname=top.document.getElementById('jobname').value;
					
					if(thediv_Foreground.style.display == "none")
					{
						thediv_Foreground.style.display = "";
						thediv_Background.style.display = "";
						thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/nameit.php?jobname="+jobname+"'></iframe></td></tr></table>";
					}
					else
					{
						thediv_Foreground.style.display = "none";
						thediv_Background.style.display = "none";
					}
					return false;
 
      }
	  
function minNumberCardA5(minimum,fieldname, discountValue, discountAmount)
      {		
	   
	  	var message = document.getElementById('message').value;
		var pic = document.getElementById('imagename').value;

		if (message == '' || pic == '')
		{
			if (message == '')
			{
			alert('Please complete your message for the inside page');
			return false;
			}
			else if (pic == '')
			{
			alert('Please choose an image for your outside page');
			return false;
			}
		}
	
	  
		 var quantity = eval(document.getElementById(fieldname).value);
		 if (quantity < minimum)
		 {
			 alert('Sorry but the minimum order is '+minimum+'!');
			 document.getElementById(fieldname).value = minimum;
			 return false;
		 }
		 
		 /////////////////discount
		 if (quantity >= discountAmount)
		 {
			document.getElementById('discount').value = discountValue; 
		 }
 

					 var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
					var thediv_Background=top.document.getElementById('displaybox_Background');
					if(thediv_Foreground.style.display == "none")
					{
						thediv_Foreground.style.display = "";
						thediv_Background.style.display = "";
						thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/nameit.php'></iframe></td></tr></table>";
					}
					else
					{
						thediv_Foreground.style.display = "none";
						thediv_Background.style.display = "none";
					}
					return false;
      }

function checkA5GCfinished(){

}

function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var msg = "You're not using Internet Explorer.";
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver >= 7.0 )
	{
	  
	}
    else
	{
      versionCheckPopup();
	}
  }
  
}

function checkMaccalculate() {
			
			if ( document.uploadorder.name.value == '' || document.uploadorder.email.value == '' || document.uploadorder.cell.value == '' || (document.uploadorder.delivery[0].checked == true && document.uploadorder.address.value == '')) 
			{
				if ( document.uploadorder.name.value == '' ) 
				{
					var nameMSG = 'Name\n';
				}
				else 
				{
					var nameMSG = '';
				}
				
				if ( document.uploadorder.email.value == '' ) 
				{
					var emailMSG = 'Email\n';
				}
				else 
				{
					var emailMSG = '';
				}
				
				if ( document.uploadorder.cell.value == '' ) 
				{
					var cellMSG = 'Cell\n';
				}
				else 
				{
					var cellMSG = '';
				}
				
				//////if courier is selected
				if ( document.uploadorder.delivery[0].checked == true && document.uploadorder.address.value == '') 
				{
					var courierMSG = 'Courier address\n';
				}
				else 
				{
					var courierMSG = '';
				}
				
							
				
					alert ( "Please enter the following information:\n"+emailMSG+""+nameMSG+""+cellMSG+""+courierMSG+"" );
					return false;
				
			}
			else
			{
				return true;
			}
}

function preview(pic) {
	
	var div = document.getElementById('preview_pix');
	div.innerHTML = '<img src="/za/php/rapidstudio/images/'+pic+'.jpg" alt="" width="241" height="147" />';
	
}


function hideoptions(){
var sizeselect = document.getElementById("size"); // select element
var size = sizeselect.options[sizeselect.selectedIndex].value; 

	if (size == 'a4p')
	{ togglemenuhide('warning_options');togglemenushow('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenushow('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("case").checked = true; document.getElementById("dustnoa4").checked = true; preview('iphoto_case'); togglemenuhide('photobook_covera3'); togglemenushow('photobook_covera4'); document.getElementById("covera4pers").checked = true}
	else if (size == 'a4l')
	{ togglemenuhide('warning_options');togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenushow('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("case").checked = true; preview('iphoto_case'); document.getElementById("dustnoa4").checked = true; togglemenuhide('photobook_covera3'); togglemenushow('photobook_covera4'); document.getElementById("covera4pers").checked = true; }
	else if (size == 'a3l')
	{ togglemenuhide('warning_options');togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenuhide('dusta4_div'); togglemenushow('dusta3_div'); document.getElementById("case").checked = true; preview('iphoto_case'); document.getElementById("dustnoa3").checked = true; togglemenushow('photobook_covera3'); togglemenuhide('photobook_covera4'); document.getElementById("covera3pers").checked = true; }
	else if (size == 'mini')
	{ togglemenuhide('warning_options');togglemenushow('sc_div'); togglemenuhide('rs_div'); togglemenuhide('case_div'); togglemenuhide('square_div'); togglemenuhide('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("sc").checked = true; preview('iphoto_saddle'); document.getElementById("dustnoa4").checked = true; document.getElementById("dustnoa3").checked = true; togglemenuhide('photobook_covera3'); togglemenuhide('photobook_covera4'); document.getElementById("covera3none").checked = true; document.getElementById("covera4none").checked = true }
	else if (size == 'a5l')
	{ togglemenuhide('warning_options');togglemenushow('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenuhide('square_div'); togglemenuhide('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("case").checked = true; preview('iphoto_case'); document.getElementById("dustnoa4").checked = true; togglemenuhide('photobook_covera3'); togglemenuhide('photobook_covera4'); document.getElementById("covera4pers").checked = true; }
	else if (size == '300')
	{ togglemenuhide('warning_options');togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div');  togglemenuhide('dusta4_div'); togglemenushow('dusta3_div'); document.getElementById("case").checked = true; preview('iphoto_case');  document.getElementById("dustnoa3").checked = true;togglemenuhide('photobook_covera4');togglemenushow('photobook_covera3'); document.getElementById("covera3pers").checked = true;}
	else if (size == '200')
	{ togglemenuhide('warning_options'); togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div');  togglemenuhide('dusta4_div'); togglemenushow('dusta3_div');document.getElementById("case").checked = true;  preview('iphoto_case');  document.getElementById("dustnoa3").checked = true;togglemenushow('photobook_covera4');togglemenuhide('photobook_covera3'); document.getElementById("covera4pers").checked = true}	
	else if (size == 'buff150' || size == 'buff200' || size == 'buff200_PLUS' || size == 'buff300' || size == 'buff300_PLUS')
	{ togglemenuhide('sc_div'); togglemenuhide('rs_div'); togglemenuhide('case_div'); togglemenuhide('paper_options'); togglemenushow('warning_options'); togglemenuhide('square_div');  togglemenuhide('dusta4_div'); togglemenuhide('dusta3_div'); togglemenushow('gerrie_div'); document.getElementById("gerrie").checked = true;  preview('iphoto_gerrie'); document.getElementById("dustnoa4").checked = true; document.getElementById("dustnoa3").checked = true ; togglemenuhide('photobook_covera4'); document.getElementById("covera4none").checked = true; document.getElementById("covera4none").checked = true }
	else
	{ togglemenuhide('warning_options');togglemenushow('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenushow('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("dustnoa4").checked = true; }
}

function hideoptions_calc(){
var sizeselect = document.getElementById("size"); // select element
var size = sizeselect.options[sizeselect.selectedIndex].value; 
	if (size == 'a4p')
	{ togglemenushow('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenushow('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("case").checked = true; preview('photo_case'); togglemenuhide('photobook_covera3'); togglemenushow('photobook_covera4'); document.getElementById("covera4pers").checked = true;document.getElementById("dustnoa4").checked = true;}
	else if (size == 'binder300')
	{ togglemenuhide('sc_div'); togglemenuhide('rs_div'); togglemenuhide('binding_row'); togglemenuhide('case_div'); togglemenuhide('square_div'); togglemenuhide('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("binder").checked = true; preview('photo_case'); togglemenuhide('photobook_covera3'); togglemenuhide('photobook_covera4'); document.getElementById("covera4pers").checked = true;document.getElementById("dustnoa4").checked = true;}
	else if (size == 'a4l')
	{ togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenushow('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("case").checked = true; preview('photo_case'); togglemenuhide('photobook_covera3'); togglemenushow('photobook_covera4'); document.getElementById("covera4pers").checked = true;document.getElementById("dustnoa4").checked = true; }
	else if (size == 'a3l')
	{ togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenuhide('dusta4_div'); togglemenushow('dusta3_div'); document.getElementById("case").checked = true; preview('photo_case'); togglemenushow('photobook_covera3'); togglemenuhide('photobook_covera4'); document.getElementById("covera3pers").checked = true;document.getElementById("dustnoa3").checked = true; }
	else if (size == 'mini')
	{ togglemenushow('sc_div'); togglemenuhide('rs_div'); togglemenuhide('case_div'); togglemenuhide('square_div'); togglemenuhide('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("sc").checked = true; preview('photo_saddle'); document.getElementById("dustnoa4").checked = true; document.getElementById("dustnoa3").checked = true; togglemenuhide('photobook_covera3'); togglemenuhide('photobook_covera4'); document.getElementById("covera3none").checked = true; document.getElementById("covera4none").checked = true;document.getElementById("dustnoa4").checked = true; }
	else if (size == 'a5l')
	{ togglemenushow('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenuhide('square_div'); togglemenushow('dusta4_div'); togglemenuhide('dusta3_div'); document.getElementById("case").checked = true; preview('photo_case'); togglemenuhide('photobook_covera3'); togglemenushow('photobook_covera4'); document.getElementById("covera4pers").checked = true;document.getElementById("dustnoa4").checked = true; }
	else if (size == '300')
	{ togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div');  togglemenuhide('dusta4_div'); togglemenushow('dusta3_div');document.getElementById("case").checked = true;  preview('photo_case');togglemenuhide('photobook_covera4');togglemenushow('photobook_covera3'); document.getElementById("covera3pers").checked = true;document.getElementById("dustnoa3").checked = true; }
	else if (size == '200')
	{ togglemenuhide('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div');  togglemenushow('dusta4_div'); togglemenuhide('dusta3_div');document.getElementById("case").checked = true;  preview('photo_case');togglemenushow('photobook_covera4');togglemenuhide('photobook_covera3'); document.getElementById("covera4pers").checked = true;document.getElementById("dustnoa4").checked = true; }
	else if (size == 'buff150' || size == 'buff200' || size == 'buff200_PLUS' || size == 'buff300' || size == 'buff300_PLUS')
	{ togglemenuhide('sc_div'); togglemenuhide('rs_div'); togglemenuhide('case_div'); togglemenuhide('square_div');  togglemenuhide('dusta4_div'); togglemenuhide('dusta3_div'); togglemenushow('gerrie_div'); document.getElementById("gerrie").checked = true;  preview('photo_gerrie'); document.getElementById("dustnoa4").checked = true; document.getElementById("dustnoa3").checked = true ; togglemenuhide('photobook_covera4'); document.getElementById("covera4none").checked = true; document.getElementById("covera4none").checked = true }
	else
	{ togglemenushow('sc_div'); togglemenushow('rs_div'); togglemenushow('case_div'); togglemenushow('square_div'); togglemenushow('dusta4_div'); togglemenuhide('dusta3_div'); }
}


	
function cardA5caption(message, heading, type){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var font=document.getElementById('font').value;
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='addCaption' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/cards/addCaption.php?message="+message+"&heading="+heading+"&font="+font+"&type="+type+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function invA5caption(message, heading, type, pc, which){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var font=document.getElementById('font').value;
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='addCaption' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/products/invites/addCaption.php?message="+message+"&heading="+heading+"&font="+font+"&type="+type+"&pc="+pc+"&which="+which+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function choosetosavejob(){
	var savejobBox=document.orderform.savejob;
	savejobBox.value='1';
	document.orderform.submit();
}

function choosetosavejobcalendar(){
	var savejobBox=document.getElementById('savejob');
	savejobBox.value='1';
	document.calendarorders.submit();
}

function livesupport(){
	alert('Sorry, but our Live Online Support is currently closed!\nPlease note our operation times below:\nMondays to Fridays 09h00-17h00\n\nFeel free to contact us on +27(11) 225-0522\n7 days-a-week 08h00-19h00');
}


// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}

function flipImage(colour) {
	var div=document.getElementById('preview');

	div.innerHTML = '<img src="/za/php/rapidstudio/products/calendars/standard/images/a3-poster-calendar-'+colour+'.jpg" alt="" width="333" height="300" border="0" />';
	
	
	
}

function clickercompetition(id){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Competition_New');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='yes' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/rapidcompetitionentries.new.php?id="+id+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerThemes(id){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Competition');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/downloads/preview.php?id="+id+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerThemesNew(id){
	
	var thediv_Foreground=window.parent.document.getElementById('displaybox_Foreground_Sample');
	var thediv_Background=window.parent.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/downloads/preview.new.php?id="+id+"'></iframe></td></tr></table>";
		
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerJobPreview(type, id){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Flash');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/share/preview_job.php?type="+type+"&id="+id+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function viewcomppic(pic,id){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/comp_preview.php?id="+id+"&pic="+pic+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function updatefriends(id){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/members/update_friends.php?id="+id+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function addfriends(id){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/members/add_friends.php?userid="+id+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickersafearea(){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Competition');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/mac_bleed.php'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerdownload(labcode, campaignid, userid){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/downloads/index.php?labcode="+labcode+"&campaignid="+campaignid+"&userid="+userid+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickermactutorials(){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Competition');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/mac_tutorials.php'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerperswallpaper(name, id){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Competition');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/members/wallpaper.php?name="+name+"&id="+id+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function uploadpics(userid, albumid, p){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Upload');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='99%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/upload/?userid="+userid+"&albumid="+albumid+"&p="+p+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}



function closeclickerCompetition(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Competition');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function closeclickerCompetition_New(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Competition_New');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}


function closeclickerupload(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Upload');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function closeclickerAddSoftware(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Upload');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}



// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

//mulitple file upload
function mysubmit(type, albumid, userid, page)
	{		
			MultiPowUpload.uploadAll('php/rapidstudio/albums/uploadfiles_execute.php?p='+page+'&albumid='+albumid+'&userid='+userid+'');
	}
	
// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

function switchSrc(targetFrame, albumid, p, x, y, w, h, div) {
   document.getElementById(targetFrame).src = "php/rapidstudio/albums/image_list.php?albumid="+albumid+"&p="+p+"&x="+x+"&y="+y+"&w="+w+"&h="+h+"&div="+div+"";
}

function check_cell_valid(){
	
	var cell = document.getElementById('updatecell').value;
	var userid = document.getElementById('userid').value;
	var software = document.getElementById('software').value;
	
	if (cell == 'Please update your cellphone number!' || cell == '' || cell == ' ')
	{
	alert('Please enter a valid cellphone number!');
	return false;
	}
	else
	{
		///divert
		if (software == '1')
		top.document.location = "../za/php/rapidstudio/members/update_cell_please.php?fromrssoftware=1&cell="+cell+"&userid="+userid;	
		else
		top.document.location = "php/rapidstudio/members/update_cell_please.php?fromrssoftware=0&cell="+cell+"&userid="+userid;	
		///divert
	}
}

function check_email_valid(){
	
	var email_verify_code = document.getElementById('email_verify_code').value;
	var userid = document.getElementById('userid').value;
	var software = document.getElementById('software').value;
	
	if (email_verify_code == '' || email_verify_code == ' ')
	{
	alert('Please enter your email verification code!');
	return false;
	}
	else
	{
		///divert
		if (software == '1')
		top.document.location = "../za/php/rapidstudio/members/verify_email_please.php?fromrssoftware=1&email_verify_code="+email_verify_code+"&userid="+userid;	
		else
		top.document.location = "php/rapidstudio/members/verify_email_please.php?fromrssoftware=0&email_verify_code="+email_verify_code+"&userid="+userid;	
		///divert
	}
}



function checkjoin(){
	
	var name = document.joinform.name.value;
	var surname = document.joinform.surname.value;
	var email = document.joinform.email.value;
	var password = document.joinform.password.value;
	var passwordconfirm = document.joinform.passwordconfirm.value;
	var terms = document.joinform.terms.length;
	
	
	if (name == '' && surname  == '' && email == '' && password  == '')
	{
		alert('Please enter the field marked with red *!');
		return false;
	}
	else if (name == '')
	{
		alert('Please enter your name!');
		return false;
	}
	else if (surname == '')
	{
		alert('Please enter your surname!');
		return false;
	}
	else if (email == '')
	{
		alert('Please enter your email address!');
		return false;
	}
	else if (password == '')
	{
		alert('Please enter a password!');
		return false;
	}
	
	if (password !== passwordconfirm)
	{
		alert('Your passwords to not match. Please re-enter your passwords!');
		return false;
	}
	
	if (document.joinform.terms.checked !== true)
	{
		alert('Please read our terms and conditions.');
		return false;
	}

}


function checkAlbumName(){
	var name = document.albumform.name.value;	
	
	if (name == '')
	{
		alert('Please enter a Name for your album!');
		return false;
	}

}

function togglemenushow (target)
{
	var browser=navigator.appName;

		  if ((browser=="Microsoft Internet Explorer"))
		  {
			document.getElementById(target).style.display = "block";
		  }
		  else
		  {
			document.getElementById(target).style.display = "table-row";
		  }
}

function togglemenuhide (target)
{
	document.getElementById(target).style.display = "none";
}

function clickerloginRapid(which, type, heading){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/login.php?p="+which+"&type="+type+"&heading="+heading+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerloginWorkshop(which, type, heading){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/login.php?p="+which+"&type="+type+"&heading="+heading+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerloginRapidReorder(which, type, heading, wt, onlinewt){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/login.php?p="+which+"&type="+type+"&heading="+heading+"&wt="+wt+"&onlinewt="+onlinewt+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerloginRapidSoftware(wt, pastelcode){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background_Software');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='softwarelogin' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/login.php?p=addsoftware&wt="+wt+"&pastelcode="+pastelcode+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}


function gotoAddSotware(wt, pastelcode){
top.document.location = '/za/addsoftware.php?process=1&pastelcode='+pastelcode+'&wt='+wt;
}

function closeClickerSoftware(){
top.document.location = '/za/?p=01269a47a6ff675cfa0afd01291b84e3';
}

function clickerAddSoftware(which, type, heading, wt){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Upload');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='software' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/addsoftware.php?p="+which+"&type="+type+"&heading="+heading+"&wt="+wt+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerAddSoftwareMakro(which, type, heading, wt){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Upload');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='software' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/addsoftwaremakro.php?p="+which+"&type="+type+"&heading="+heading+"&wt="+wt+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerAddSoftwareThroughSoftware(which, type, heading, wt){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Upload');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='software' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/addsoftware.php?p="+which+"&type="+type+"&heading="+heading+"&wt="+wt+"&fromrssoftware=1'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}


function bypassquestions(wt, userid, price, fromrssoftware){
	if (document.getElementById('did_modify').value == 1 || document.getElementById('checkdelivery').value == 0)
	{
		if (document.getElementById('did_modify').value == 1)
		{
		alert('Your quantities have changed!\nPlease click on the "ALTER" button before you Checkout');
		}
		
		var checked = document.getElementById('checkdelivery').value;
		if (checked == 0)
		{
			alert('Please select your delivery options!');
		}
		
	return false;	
	}
	else
	{
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='software' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/members/bypass_questions.php?wt="+wt+"&userid="+userid+"&price="+price+"&fromrssoftware="+fromrssoftware+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
	}
}

function reprintorder(wt, userid, price, fromrssoftware){
	
	if (document.getElementById('did_modify').value == 1 || document.getElementById('checkdelivery').value == 0)
	{
		
		if (document.getElementById('did_modify').value == 1)
		{
		alert('Your quantities have changed!\nPlease click on the "ALTER" button before you Checkout');
		}
		
		var checked = document.getElementById('checkdelivery').value;
		if (checked == 0)
		{
			alert('Please select your delivery options!');
		}
		
	return false;	
	}
	else
	{
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
		if(thediv_Foreground.style.display == "none")
		{
			thediv_Foreground.style.display = "";
			thediv_Background.style.display = "";
			thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='software' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/members/reprint_order.php?wt="+wt+"&userid="+userid+"&price="+price+"&fromrssoftware="+fromrssoftware+"'></iframe></td></tr></table>";
		}
		else
		{
			thediv_Foreground.style.display = "none";
			thediv_Background.style.display = "none";
		}
	return false;
	}
}



function choosepayment(type, wt, rssoftware) {
top.document.location = '/za/php/rapidstudio/members/choosepayment.php?type='+type+'&wt='+wt+'&fromrssoftware='+rssoftware;			
}

function closefriendupdate() {
top.document.location = '/za/?p=310fc2bd6eb089c320b379705a78e4c2&tab=2';			
}


function whatisroyaltypoints(){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/whatisroyaltypoints.php'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickersendcd(labcode){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_cd');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/sendcd.php?labcode="+labcode+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerloginRapidMAC(){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/login.php?p=2&type=rapidmac&heading=iPHOTO'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickercustom(wt){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/custom.php?wt="+wt+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}


function versionCheckPopup(){
	top.document.location = '/za/?p=ec690490c192a0618e9d390c6ba6187f';
	/*
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/versioncheck.php'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
	*/
}

function loadPoints(page){
	top.document.location = '/za/?p='+page+'';
}

function clickerTerms(which, type, heading){
	var thediv_Foreground=document.getElementById('displaybox_Foreground');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='yes' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/terms.php?close=1'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}


function clickerdistpoints(labcode, wt, insert){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_dist');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/distpoints.php?labcode="+labcode+"&wt="+wt+"&insert="+insert+"&search=1&add=Johannesburg'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerdistpointsRS(labcode, wt, insert){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_dist');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/distpoints.php?fromrs=1&labcode="+labcode+"&wt="+wt+"&insert="+insert+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}


function tracking(type,data){
	if (type == 'cell' || type == 'email')
	top.document.location = '/za/?p=27553c0561973bee59955b80a240317f&tracking=1&track='+type+'&data='+data;
	else if (type == 'ref')
	top.document.location = '/za/?p=ffee41fef6aaaf98c50cc08a7b101bbd&onlinewt='+data;
	else if (type == 'orderno')
	top.document.location = '/za/?p=ffee41fef6aaaf98c50cc08a7b101bbd&rs=1&onlinewt=0&orderno='+data;
}

function clickertracking(which){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='400px'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='tracking' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/tracking_landing.php'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}



function albumSlideShow(albumid, userid){
	var thediv_Foreground=document.getElementById('displaybox_Foreground');
	var thediv_Background=document.getElementById('displaybox_Background');
	
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='slideshow' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/albums/slideshow.php?id="+albumid+"&u="+userid+"'></iframe></td></tr></table>";
	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}


function clickerdeladdy(id){
	var screenwidth = screen.width;
	var screenheight = screen.height;

	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/add_del.php?id="+id+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}
function clickerdeladdyedit(id){
	//var screenwidth = screen.width;
	//var screenheight = screen.height;

	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/edit_del.php?id="+id+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickerFlash(which, heading){
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Flash');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/flash/index.php?p="+which+"&heading="+heading+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function checkjpg(){
	
	var file1 = document.getElementById('file1').value;
	var file1type = file1.split(".");
	if (file1 != '' && file1type[0] == 'jpg' || file1 != '' && file1type[1] == 'jpg' || file1 != '' && file1type[2] == 'jpg' || file1 != '' && file1type[0] == 'JPG' || file1 != '' && file1type[1] == 'JPG' || file1 != '' && file1type[2] == 'JPG' || file1 == '')
	{
	var fileok1 = 1;
	var txt1 = "";
	}
	else
	{
	var fileok1 = 0;
	var txt1 = "Photo 1 is not a JPG file, please choose another file.\n";
	}
	
	var file2 = document.getElementById('file2').value;
	var file2type = file2.split(".");
	if (file2 != '' && file2type[0] == 'jpg' || file2 != '' && file2type[1] == 'jpg' || file2 != '' && file2type[2] == 'jpg' || file2 != '' && file2type[0] == 'JPG' || file2 != '' && file2type[1] == 'JPG' || file2 != '' && file2type[2] == 'JPG' || file2 == '')
	{
	var fileok2 = 1;
	var txt2 = "";
	}
	else
	{
	var fileok2 = 0;
	var txt2 = "Photo 2 is not a JPG file, please choose another file.\n";
	}
	
	var file3 = document.getElementById('file3').value;
	var file3type = file3.split(".");
	if (file3 != '' && file3type[0] == 'jpg' || file3 != '' && file3type[1] == 'jpg' || file3 != '' && file3type[2] == 'jpg' || file3 != '' && file3type[0] == 'JPG' || file3 != '' && file3type[1] == 'JPG' || file3 != '' && file3type[2] == 'JPG' || file3 == '')
	{
	var fileok3 = 1;
	var txt3 = "";
	}
	else
	{
	var fileok3 = 0;
	var txt3 = "Photo 3 is not a JPG file, please choose another file.\n";
	}
	
	var file4 = document.getElementById('file4').value;
	var file4type = file4.split(".");
	if (file4 != '' && file4type[0] == 'jpg' || file4 != '' && file4type[1] == 'jpg' || file4 != '' && file4type[2] == 'jpg' || file4 != '' && file4type[0] == 'JPG' || file4 != '' && file4type[1] == 'JPG' || file4 != '' && file4type[2] == 'JPG' || file4 == '')
	{
	var fileok4 = 1;
	var txt4 = "";	
	}
	else
	{
	var fileok4 = 0;
	var txt4 = "Photo 4 is not a JPG file, please choose another file.\n";
	}
	
	var file5 = document.getElementById('file5').value;
	var file5type = file5.split(".");
	if (file5 != '' && file5type[0] == 'jpg' || file5 != '' && file5type[1] == 'jpg' || file5 != '' && file5type[2] == 'jpg' || file5 != '' && file5type[0] == 'JPG' || file5 != '' && file5type[1] == 'JPG' || file5 != '' && file5type[2] == 'JPG' || file5 == '')
	{
	var fileok5 = 1;
	var txt5 = "";
	}
	else
	{
	var fileok5 = 0;
	var txt5 = "Photo 5 is not a JPG file, please choose another file.\n";
	}
	
	if (fileok1 == 0 || fileok2 == 0 || fileok3 == 0 || fileok4 == 0 || fileok5 == 0)
	{
	alert(txt1+""+txt2+""+txt3+""+txt4+""+txt5+"");
	return false;
	}
	else
	{}
	
}
function choosePhotoFromAlbum(userid, which, wt, calid, x, y, width, height, div, heading, date, imagename){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_dist');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	//alert('p');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='choosealbum' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/albums/chooseAlbum.php?heading="+heading+"&userid="+userid+"&p="+which+"&wt="+wt+"&calid="+calid+"&x="+x+"&y="+y+"&width="+width+"&height="+height+"&div="+div+"&date="+date+"&imagename="+imagename+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
	}
	return false;
}

function addCaption(calid, div, heading, date, field){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='addCaption' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/albums/addCaption.php?heading="+heading+"&calid="+calid+"&div="+div+"&date="+date+"&field="+field+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function clickeraddalbum(userid, which){
	
	var thediv_Foreground=document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='login' height='100%' width='100%' allowtransparency='no' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='/za/php/rapidstudio/albums/index.php?userid="+userid+"&p="+which+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function checkcdrequest() {
			
			if ( document.PostTest.email.value == '' || document.PostTest.cell.value == '' || document.PostTest.name.value == '') 
			{
				if ( document.PostTest.email.value == '' ) 
				{
					var emailMSG = 'Email Address\n';
				}
				else 
				{
					var emailMSG = '';
				}
				
				if ( document.PostTest.cell.value == '' ) 
				{
					var cellMSG = 'Cell Number\n';
				}
				else 
				{
					var cellMSG = '';
				}
				
				if ( document.PostTest.name.value == '' ) 
				{
					var nameMSG = 'Your Name\n';
				}
				else 
				{
					var nameMSG = '';
				}
				
				if ( document.PostTest.add1.value == '' || document.PostTest.add2.value == '' || document.PostTest.add3.value == '' ) 
				{
					var addMSG = 'Your Address details\n';
				}
				else 
				{
					var addMSG = '';
				}
				
								
				
					alert ( "Please enter the following information:\n"+nameMSG+""+cellMSG+""+emailMSG+""+addMSG+"" );
					return false;
				
			}
			else
			{
				return true;
			}
}

function closeclickerlogin(){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}


function closeclickerloginRSDIST(){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_dist');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function closeclickercd(){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_cd');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function closeclickerloginFlash(){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Flash');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function closeclickerloginPers(){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Sample');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function closeclickerloginPage(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}


function closeclickerTracker(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";

}

function closeclickerTrackerGo(campaignid, aff){
		top.document.location = "/za/?aff="+aff+"&p=01269a47a6ff675cfa0afd01291b84e3&templates=c81e728d9d4c2f636f067f89cc14862c&campaignid="+campaignid;
}

function closeclickerTrackerGoparty(){
		top.document.location = "/za/?p=5c75bc5105f9ff59819b915f791b174b";
}



function closeclickerMakro(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Makro');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function closeclickerMakro(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Makro');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}

function MakroSoftware(){
top.document.location = '/za/?p=01269a47a6ff675cfa0afd01291b84e3&templates=c81e728d9d4c2f636f067f89cc14862c';	
}

function gotomacpage(){
	top.document.location = '/za/?p=4efaa5addedeb4913f22811a5ca1eb54';
}

function sizeGet(){
	var size = document.getElementById('pastelcode').value;
top.document.location = '/za/?p=97cc2556e163e672d8d04c40ba135c33&size='+size+'';
}
				   
function closeclickerloginPageThumbnail(p, id, uid){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');

		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	
		top.document.location = '/za/?p='+p+'&albumid='+id+'';
}

function divertToPage(p){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');

		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	
		top.document.location = '/za/?p='+p+'';
}

function closecanvas(p){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');

		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
}


function gotoPayment(id, aff, copies){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');

		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	
		top.document.location = 'http://www.rapidstudio.co.za/payment/ChoosePaymentMethod.New.php?id='+id+'&zip_arrival=0&reorder=0&macorder=0&aff='+aff+'&copies='+copies;
}

function gotoFiles(id){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');

		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	
		top.document.location = '/za/?p=0bb668bc5c92e196adfe372d055f3da4&id='+id;
}


function closeuploaddone(p, albumid){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Upload');
	var thediv_Background=top.document.getElementById('displaybox_Background');

		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	
		top.document.location = '/za/?p='+p+'&albumid='+id+'';
}



function closeclickerimage(){
	
	var thediv_Foreground1=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Foreground2=top.document.getElementById('displaybox_Foreground_Upload');
	var thediv_Foreground3=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground1.style.display = "none";
		thediv_Foreground2.style.display = "none";
		thediv_Foreground3.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground1.innerHTML = "";
		thediv_Foreground2.innerHTML = "";
		thediv_Foreground3.innerHTML = "";
		
}

function closeclickercrop(divname, wt, filename, img_width, img_height){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_dist');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Photo=top.document.getElementById(divname);
	var thediv_Button=top.document.getElementById('addshoppingbutton');
	var thediv_SaveButton=top.document.getElementById('savejobtr');
	var imagefield=top.document.orderform.imagename;
	var browser=navigator.appName;
			if ((browser=="Microsoft Internet Explorer"))
			  {
				thediv_SaveButton.style.display='block';
			  }
			  else
			  {
				thediv_SaveButton.style.display="block";
			  }	
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		thediv_Photo.innerHTML = "<img src='/za/php/rapidstudio/tickets/"+wt+"/images/"+filename+"' width='"+img_width+"' height='"+img_height+"' />";
		thediv_Button.innerHTML = "<input type='image' name='imageField' id='imageField' src='/za/php/rapidstudio/images/add-to-shopping-cart.jpg' />";
		imagefield.value=filename;
}

function activateshoppingbutton(){
	var thediv_Button=top.document.getElementById('addshoppingbutton');
		thediv_Button.innerHTML = "<input type='image' name='imageField' id='imageField' src='/za/php/rapidstudio/images/add-to-shopping-cart.jpg' />";
}

function closeclickercropCards(divname, wt, filename, img_width, img_height, which){

	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Photo=top.document.getElementById(divname);
	var thediv_Button=top.document.getElementById('addshoppingbutton');
	var thediv_SaveButton=top.document.getElementById('savejobtr');
	var thediv_Links=top.document.getElementById('links');
	var imagefield=top.document.orderform.imagename;
	var browser=navigator.appName;
			if ((browser=="Microsoft Internet Explorer"))
			  {
				thediv_SaveButton.style.display='block';
			  }
			  else
			  {
				thediv_SaveButton.style.display="block";
			  }	
			  
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		thediv_Photo.innerHTML = "<img src='/za/php/rapidstudio/tickets/"+wt+"/images/"+filename+"' width='"+img_width+"' height='"+img_height+"' />";
		thediv_Button.innerHTML = "<input type='image' name='imageField' id='imageField' src='/za/php/rapidstudio/images/add-to-shopping-cart.jpg' />";
		thediv_Links.innerHTML = "<a href='/za/?p="+which+"&page=outside&img="+filename+"'>Go to the outside of your Greeting Card</a> / <a href='/za/?p="+which+"&page=inside&img="+filename+"'>Go to the inside of your Greeting Card</a>";
		imagefield.value=filename;
		
		
}

function closecardA5caption(message, font){

	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Message=top.document.getElementById('message');
	var thediv_Font=top.document.getElementById('font');
	var thediv_InsideText=top.document.getElementById('insidetext');
	var thediv_Button=top.document.getElementById('addshoppingbutton');
	var thediv_showButton=top.document.getElementById('processorder');
	var thediv_SaveButton=top.document.getElementById('savejobtr');
		thediv_Message.value = message;
		thediv_Font.value = font;
		top.document.orderform.submit();
}

function closeinvA5caption(message, font, which){

	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Message=top.document.getElementById(which);
	var thediv_Font=top.document.getElementById('font');
	var thediv_InsideText=top.document.getElementById('insidetext');
	var thediv_Button=top.document.getElementById('addshoppingbutton');
	var thediv_showButton=top.document.getElementById('processorder');
	var thediv_SaveButton=top.document.getElementById('savejobtr');
		thediv_Message.value = message;
		thediv_Font.value = font;
		top.document.orderform.submit();
}


function closeclickeralbumcreate(which){

	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		top.document.location = '/za/?p='+which;
}


function closeclickercaption(divname, captiontext){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Photo=top.calendar_data.document.getElementById(divname);
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		thediv_Photo.innerHTML = '<div align="center" class="grey_boldMEDIUM">'+captiontext+'</div>';

}


function updateFilename(filename, wt, date, calid, div) {


req = null;
				  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/products/calendars/standard/insertDateAjax.php?calid="+calid+"&month="+date+"&filename="+filename+"&divname="+div+"", false);
	
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	
	
		  
	req.send(null);
	//alert('lop'+req.responseText);	
}



function showMonthSelectedImages(date, calid) {	

	var newDate = 'pixure_'+date.replace(" ","");
	var div = top.document.getElementById(newDate);
	
	req = null;
				  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/products/calendars/standard/getDateAjax.php?calid="+calid+"&month="+date+"&txt=0", false);
	
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			  
	req.send(null);
	
	div.innerHTML = req.responseText;
	showMonthSelectedImagesTXT(date, calid);
}

function showMonthSelectedImagesTXT(date, calid) {	

	var newDate = 'txt_'+date.replace(" ","");
	var div = top.document.getElementById(newDate);
	
	req = null;
				  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/products/calendars/standard/getDateAjax.php?calid="+calid+"&month="+date+"&txt=1", false);
	
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			  
	req.send(null);
	
	div.innerHTML = req.responseText;
}



function totalsgot(calid){
	req = null;
				  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/products/calendars/standard/totalsAjax.php?calid="+calid+"&got=1", false);
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				  
	req.send(null);

	var div = top.document.getElementById('gottotals');
	div.value = req.responseText;
	totalsneed(calid, req.responseText);
}

function totalsneed(calid, gottotal){
	req = null;
				  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/products/calendars/standard/totalsAjax.php?calid="+calid+"&got=0", false);
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				  
	req.send(null);
	
	var div = top.document.getElementById('needtotals');
	div.value = req.responseText;
	
	stdcalcompleteCheck_fromimages (gottotal, req.responseText);
}


function unhideproceedbutton(target) {
							  
		var browser=navigator.appName;

		  if ((browser=="Microsoft Internet Explorer"))
		  {
			parent.document.getElementById('continueButton').style.display='block';
		  }
		  else
		  {
			parent.document.getElementById('continueButton').style.display="table-row";
		  }							  
							  
							  
							  
}
							  
							  
							  
function closeclickercropCalendars(heading, divname, wt, filename, img_width, img_height, date, calid){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_dist');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Photo=top.calendar_data.document.getElementById(divname);
	
	updateFilename(filename, wt, date, calid, divname);
	
		showMonthSelectedImages(date, calid);
		totalsgot(calid);
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		thediv_Photo.innerHTML = "<img src='/za/php/rapidstudio/tickets/"+wt+"/images/"+filename+"' width='"+img_width+"' height='"+img_height+"' />";
}

	  
function closeclickertheme(subtype, filename, theme){
	
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	var thediv_Theme=top.document.getElementById('theme');
	var themefield=top.document.orderform.themename;
	
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
		thediv_Theme.innerHTML = "<img src='/za/php/rapidstudio/products/mousepads/themes/"+subtype+"/"+theme+"/"+filename+".png' />";
		themefield.value=filename;
}

function file_get_contents( url ) {
    // http://kevin.vanzonneveld.net
    // + original by: Legaev Andrey
    // + input by: Jani Hartikainen
    // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // % note 1: This function uses XmlHttpRequest and cannot retrieve resource from different domain.
    // % note 1: Synchronous so may lock up browser, mainly here for study purposes. 
    // % note 1: To avoid browser blocking issues's consider using jQuery's: $('#divId').load('http://url') instead.
    // * example 1: file_get_contents('http://kevin.vanzonneveld.net/pj_test_supportfile_1.htm');
    // * returns 1: '123'
 
    var req = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
    if (!req) throw new Error('XMLHttpRequest not supported');
    
    req.open("GET", url, false);
    req.send(null);
    
    return req.responseText;
}

var max_char = 200;
	  // the maximum number of chars allowed
function zaehlenD() 
	  {
	  	var sig = document.form1.description.value;
	  	// the textarea in which the user types
	  	//var zaehler = document.form1.char.value; 
	  	// the input-field, where the chars left will be shown   
	  		if(sig.length > max_char) 
			{    
	  		var x = sig.substring(0, max_char);    
	  		zaehler = 0;     
	  		document.form1.description.value = x;    
	  		setTimeout("zaehlenD()",100);  
	  		} 
			else
			{     
	  		//document.form1.char.value = max_char - sig.length;    
	  		setTimeout("zaehlenD()",100);  
			}
}
		
function zaehlenT() 
	  {
	  	var sig = document.form1.tags.value;
	  	// the textarea in which the user types
	  	//var zaehler = document.form1.char.value; 
	  	// the input-field, where the chars left will be shown   
	  		if(sig.length > max_char) 
			{    
	  		var x = sig.substring(0, max_char);    
	  		zaehler = 0;     
	  		document.form1.tags.value = x;    
	  		setTimeout("zaehlenT()",100);  
	  		} 
			else
			{     
	  		//document.form1.char.value = max_char - sig.length;    
	  		setTimeout("zaehlenT()",100);  
			}
}

function checkIfModified(){
	if (document.getElementById('did_modify').value == 1)
	{
	alert('Your quantities have changed!\nPlease click on the "ALTER" button before you Checkout');
	return false;
	}
}


function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }
	  
function isNumberKeyMakro(evt, userid)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
         {
		 return false;
		 }
		 else
		 {
		 		req = null; 
				if (window.XMLHttpRequest) {
				req = new XMLHttpRequest();
				} 
				else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
				}
				var data = String.fromCharCode(charCode);
				req.open("POST", "/za/php/rapidstudio/members/insertmakro.php?character="+data+"&userid="+userid, false);
				req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				req.send(null);
				return true;
		 }
		 
      }
	  
function isNumberKeyCart(evt)
      {
		  document.getElementById('did_modify').value = 1;
		  togglemenushow('modify_show');
		  togglemenuhide('modify_hide');
		  
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
      }
	  
	  
////////////////////////////////////////////////////////////pic uploaded + crop
function clickerimageload(product, id, heading, x, y, filename, album, div, im_width, im_height, album_id){
	//alert(album_id);
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/crop/crop_photo.php?p="+product+"&userid="+id+"&heading="+heading+"&x="+x+"&y="+y+"&f="+filename+"&a="+album+"&firsttime=1&div="+div+"&w="+im_width+"&h="+im_height+"&albumid="+album_id+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}	
		
////////////////////////////////////////////////////////////pic uploaded + crop


function discountPopUp(discount){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/discountpopup.php?discount="+discount+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function valentinesPopUp(email){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/valentinespopup.php?email="+email+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function canvasPopUp(name, email){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/canvaspopup.php?name="+name+"&email="+email+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function party(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/party.php'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function absaPopUp(discount){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Tracking');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/discountpopup.php?discount=absa'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}

function makroPopUp(discount){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Makro');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/discountpopup.php?discount=makro'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}


////////////////////////////////////////////////////////////pic preview
function clickerimageloadPreview(product, id, heading, x, y, filename, album, div, im_width, im_height, album_id, edit_id){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/albums/preview_photo.php?p="+product+"&userid="+id+"&heading="+heading+"&x="+x+"&y="+y+"&f="+filename+"&a="+album+"&firsttime=1&div="+div+"&w="+im_width+"&h="+im_height+"&albumid="+album_id+"&edit="+edit_id+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}	
		
////////////////////////////////////////////////////////////pic preview


////////////////////////////////////////////////////////////upload new image
function uploadimage(return_page, album_id, x, y, albumname, heading, userid){
	//alert(album_id);
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/crop/upload_and_crop_photo.php?p="+return_page+"&albumid="+album_id+"&albumname="+albumname+"&x="+x+"&y="+y+"&heading="+heading+"&userid="+userid+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}	
		
////////////////////////////////////////////////////////////upload new image

////////////////////////////////////////////////////////////voucher
function checkrapidvoucher(wt, total, fromsoftware) {
	var div = document.getElementById('vouchertxt');
	var voucher_orig = document.getElementById('voucher').value;
	var voucher = voucher_orig.replace("#", "");
	req = null;
				  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/members/checkvoucherAjax.php?voucher="+voucher+"&total="+total+"&wt="+wt, false);
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
				  
	req.send(null);
	div.innerHTML = req.responseText;
	
	checkrapidvoucherToProcess(wt, voucher, total, fromsoftware);
}

function checkrapidvoucherToProcess(wt, voucher, total, fromsoftware) {
	
	req = null;		  
	if (window.XMLHttpRequest) {
	req = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject) {
	req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	req.open("POST", "/za/php/rapidstudio/members/checkvoucherAjax.php?voucher="+voucher+"&txt=1&total="+total+"&wt="+wt, false);
	req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");	  
	req.send(null);
	if (req.responseText == 1)
	{
		window.location = '/za/php/rapidstudio/members/insertVoucher.php?wt='+wt+'&total='+total+'&voucher='+voucher+'&fromrssoftware='+fromsoftware;
	}
	else if (req.responseText == 2)
	{
		window.location = '/za/php/rapidstudio/members/insertVoucher.php?wt='+wt+'&total='+total+'&voucher='+voucher+'&fromrssoftware='+fromsoftware+'&promo=1';
	}
}
////////////////////////////////////////////////////////////voucher


////////////////////////////////////////////////////////////forgottenpassowrd
function forgottenpassword(){
	//alert(album_id);
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_Login');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='photocrop' height='100%' width='100%' allowtransparency='false' scrolling='no' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/members/forgottenpassword_login.php'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}	
		
////////////////////////////////////////////////////////////forgottenpassowrd

////////////////////////////////////////////////////////////themes
function clickerthemes(product, subproduct, theme, heading){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	if(thediv_Foreground.style.display == "none")
	{
		thediv_Foreground.style.display = "";
		thediv_Background.style.display = "";
		thediv_Foreground.innerHTML = "<table width='100%' height='100%' style='z-index:30'><tr><td align='center' valign='middle' width='100%' height='100%'><iframe name='themes' height='100%' width='100%' allowtransparency='false' scrolling='auto' marginwidth='0' marginheight='0' border='0' frameborder='0' src='php/rapidstudio/products/"+product+"/themes/themes.php?type="+subproduct+"&theme="+theme+"&heading="+heading+"'></iframe></td></tr></table>";

	}
	else
	{
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
	}
	return false;
}	
		
////////////////////////////////////////////////////////////themes


////////////////////////////////////////////////////////////thumbnail
function closethumbnail(){
	var thediv_Foreground=top.document.getElementById('displaybox_Foreground_image');
	var thediv_Background=top.document.getElementById('displaybox_Background');
	
		thediv_Foreground.style.display = "none";
		thediv_Background.style.display = "none";
		thediv_Foreground.innerHTML = "";
}	
		
////////////////////////////////////////////////////////////thumbnail



////////////////////////////////////////////////////////////calendars check completion
function stdcalcompleteCheck () {
		  setInterval("stdcalcomplete()", 1000);
		}

function stdcalcomplete() {
	var got = top.document.getElementById('gottotals').value;
	var need = top.document.getElementById('needtotals').value;
	var button = document.getElementById('continuebutton_show');

	if (eval(got) < eval(need))
	{
		button.style.display = 'none';
	}
	else
	{
		button.style.display = 'block';
	}
}

function stdcalcompleteCheck_fromimages (got, total) {
		  setInterval("stdcalcomplete_fromimages("+got+", "+total+")", 1000);
		}
		
function stdcalcomplete_fromimages(got, total) {
	var button = document.getElementById('continuebutton_show');

	if (eval(got) < eval(total))
	{
		//button.style.display = 'none';
	}
	else
	{
		//button.style.display = 'block';
	}
}

////////////////////////////////////////////////////////////calendars check completion

//////////------------------------------------mouse dragger
//Draggable Div by surren @ http://www.diffusedreality.com 
var x_dragger;
var y_dragger;
var element;
var being_dragged = false;
function mouser(event)
{
	if(event.offsetX || event.offsetY) 
	{
	x_dragger=event.offsetX;
	y_dragger=event.offsetY;
	}
	else 
	{
	x_dragger=event.pageX;
	y_dragger=event.pageY;
	}
document.getElementById('X').innerHTML = x_dragger +'px';
document.getElementById('Y').innerHTML = y_dragger +'px';
document.getElementById('X-coord').innerHTML = x_dragger +'px';
document.getElementById('Y-coord').innerHTML = y_dragger +'px';
	if(being_dragged == true) 
	{
	document.getElementById(element).style.left = x_dragger +'px';
	document.getElementById(element).style.top = y_dragger +'px';
	}
}

function mouse_down(ele_name) {
being_dragged = true;
element = ele_name;
document.getElementById(element).style.cursor = 'move';
}

function mouse_up() {
being_dragged = false;
document.getElementById(element).style.top = y_dragger +'px';
document.getElementById(element).style.left = x_dragger +'px';
document.getElementById(element).style.cursor = 'auto';
}
//////////------------------------------------mouse dragger

