var btnObj = new Array();

//set button default status & assign the images of rollover and rollout 
function makeButton(idName, clkAction, imgOverUrl, imgOutUrl, imgDwnUrl, submenu){
	this.imgelem = document.getElementById(idName);
	this.clickStatus = clkAction;//1: clicked on, 0: clicked off
	this.imgOver = imgOverUrl;
	this.imgOut = imgOutUrl;
	this.imgDwn = imgDwnUrl;
	this.name = idName; 
	this.submenu = submenu;//false or true 
	return this;
}
//do once when file onload
function btninit(){
	btnObj.push(new makeButton('home', 0, "images/nav_homeOver.jpg", "images/nav_homeOut.jpg", "images/nav_homeDwn.jpg",false));
	btnObj.push(new makeButton('about', 0, "images/nav_aboutOver.jpg", "images/nav_aboutOut.jpg", "images/nav_aboutDwn.jpg",true));
	btnObj.push(new makeButton('productServices', 0, "images/nav_psOver.jpg", "images/nav_psOut.jpg", "images/nav_psDwn.jpg",true));
	btnObj.push(new makeButton('newsEvents', 0, "images/nav_neOver.jpg", "images/nav_neOut.jpg", "images/nav_neDwn.jpg",true));
	btnObj.push(new makeButton('facilities', 0, "images/nav_facilitiesOver.jpg", "images/nav_facilitiesOut.jpg", "images/nav_facilitiesDwn.jpg",false));
	btnObj.push(new makeButton('testimonials', 0, "images/nav_testimonialsOver.jpg", "images/nav_testimonialsOut.jpg", "images/nav_testimonialsDwn.jpg",false));
	btnObj.push(new makeButton('giftvouchers', 0, "images/nav_giftvouchersOver.jpg", "images/nav_giftvouchersOut.jpg", "images/nav_giftvouchersDwn.jpg",false));
	btnObj.push(new makeButton('faq', 0, "images/nav_faqOver.jpg", "images/nav_faqOut.jpg", "images/nav_faqDwn.jpg",false));
	btnObj.push(new makeButton('contact', 0, "images/nav_contactOver.jpg", "images/nav_contactOut.jpg", "images/nav_contactDwn.jpg",false));
	btnObj.push(new makeButton('subnav_product', 0, "images/subnav_productOver.jpg", "images/subnav_productOut.jpg", "images/subnav_productOut.jpg",false));
	btnObj.push(new makeButton('subnav_services', 0, "images/subnav_servicesOver.jpg", "images/subnav_servicesOut.jpg", "images/subnav_servicesOut.jpg",false));
	btnObj.push(new makeButton('subnav_profile', 0, "images/subnav_profileOver.jpg", "images/subnav_profileOut.jpg", "images/subnav_profileOut.jpg",false));
	btnObj.push(new makeButton('subnav_career', 0, "images/subnav_careerOver.jpg", "images/subnav_careerOut.jpg", "images/subnav_careerOut.jpg",false));
	btnObj.push(new makeButton('subnav_news', 0, "images/subnav_newsOver.jpg", "images/subnav_newsOut.jpg", "images/subnav_newsOut.jpg",false));
	btnObj.push(new makeButton('subnav_events', 0, "images/subnav_eventsOver.jpg", "images/subnav_eventsOut.jpg", "images/subnav_eventsOut.jpg",false));
}
// set all buttons' status when there is a mouse click
function setBtnClicked(indx){
	for (var i=0; i<btnObj.length; i++){
		if (i != indx){	
			btnObj[i].clickStatus = 0;
			btnObj[i].imgelem.src = btnObj[i].imgOut;			
		}	
	}
	
	btnObj[indx].clickStatus = 1;
	btnObj[indx].imgelem.src = btnObj[indx].imgDwn;	
}
//execute an button action
function btnAction(idName){
	//scroll the content window back to top most
	document.getElementById("content_welcomeTxt").scrollTop=0;
	document.getElementById("content_welcomeTxt").style.height = "328px";
	document.getElementById("content_welcomeTxt").style.width = "658px";
	document.getElementById("content_welcomeTxt").style.overflowY = "auto"; 
	document.getElementById("content_welcomeTxt").style.top = "0px"; 
	changecss('#sg_wrapper','width','646px');	
	
	switch(idName){
		case "home":
			setBtnClicked(0);
			parseXML('xmlContent.xml','home','header_welcomeTxt','content_welcomeTxt');
			document.getElementById("content_welcomeTxt").style.height = "360px";	
			document.getElementById("content_welcomeTxt").style.width = "682px";	
			document.getElementById("content_welcomeTxt").style.overflowY = "hidden"; 
			if (navigator.appName=="Microsoft Internet Explorer"){
				document.getElementById("content_welcomeTxt").style.top = "0px"; 
			}else{
				document.getElementById("content_welcomeTxt").style.top = "-20px"; 
			}
			break;
		case "about"://About
		case "subnav_profile"://About
			setBtnClicked(1);
			parseXML('xmlContent.xml','about','header_welcomeTxt','content_welcomeTxt');
			showDivBlock("subnav_about", "hidden");
			break;
		case "subnav_career":
			setBtnClicked(1);
			parseXML('xmlContent.xml','career','header_welcomeTxt','content_welcomeTxt');
			showDivBlock("subnav_about", "hidden");
			break;					
		case "productServices"://products
		case "subnav_product":
			setBtnClicked(2);
			parseXML('xmlContent.xml','product','header_welcomeTxt','content_welcomeTxt');
			showDivBlock("subnav_productServices", "hidden");
			break;	
		case "product_beauty":
			setBtnClicked(2);	
			document.getElementById("content_welcomeTxt").style.height = "340px";			
			parseXML('xmlContent.xml','product_beauty','header_welcomeTxt','content_welcomeTxt');
			break;	
		case "product_recommendedRange":
			setBtnClicked(2);	
			document.getElementById("content_welcomeTxt").style.height = "340px";		
			parseXML('xmlContent.xml','product_recommendedRange','header_welcomeTxt','content_welcomeTxt');
			break;			
		//services			
		case "subnav_services":
		case "services_beauty":
			setBtnClicked(2);
			parseXML('xmlContent.xml','services_beauty','header_welcomeTxt','content_welcomeTxt');
			showDivBlock("subnav_productServices", "hidden");
			createForm_services('form_servicesBeauty'); 
			break;
		case "thankyou_beautyServices":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_beautyServices','header_welcomeTxt','content_welcomeTxt');
			break;					
		case "services_bustcare":
			setBtnClicked(2);
			parseXML('xmlContent.xml','services_bustcare','header_welcomeTxt','content_welcomeTxt');
			createForm_services('form_promotionBustCare');   
			break;	
		case "thankyou_bustCare":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_bustCare','header_welcomeTxt','content_welcomeTxt');
			break;
		case "services_menFacial":
			setBtnClicked(2);
			document.getElementById("content_welcomeTxt").style.width = "912px";
			parseXML('xmlContent.xml','services_menFacial','header_welcomeTxt','content_welcomeTxt');
			createForm_promotion('form_servicesMenFacial');   
			document.getElementById("sg_wrapper").style.width = "850px";
			break;	
		case "thankyou_menFacial":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_menFacial','header_welcomeTxt','content_welcomeTxt');
			break;					
		case "menFacial_IPL":
			setBtnClicked(2);
			document.getElementById("content_welcomeTxt").style.width = "912px";
			parseXML('xmlContent.xml','menFacial_IPL','header_welcomeTxt','content_welcomeTxt');
			createForm_promotion('form_IPL');  
			document.getElementById("sg_wrapper").style.width = "850px"; 
			break;	
		case "thankyou_IPL":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_IPL','header_welcomeTxt','content_welcomeTxt');
			break;			
		case "menFacial_hairSpa":
			setBtnClicked(2);
			document.getElementById("content_welcomeTxt").style.width = "912px";
			parseXML('xmlContent.xml','menFacial_hairSpa','header_welcomeTxt','content_welcomeTxt');
			createForm_services('form_servicesHairSpa');   
			document.getElementById("sg_wrapper").style.width = "850px"; 
			break;	
		case "menFacial_testimonials":
			setBtnClicked(2);
			document.getElementById("content_welcomeTxt").style.width = "912px";
			parseXML('xmlContent.xml','menFacial_testimonials','header_welcomeTxt','content_welcomeTxt');
			break;			
		case "promotion_hairSpa":
			setBtnClicked(2);
			parseXML('xmlContent.xml','promotion_hairSpa','header_welcomeTxt','content_welcomeTxt');
			createForm_services('form_servicesHairSpa');   
			break;	
		case "thankyou_hairSpa":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_hairSpa','header_welcomeTxt','content_welcomeTxt');
			break;	
		//news and events																			
		case "newsEvents":
		case "subnav_news":
			setBtnClicked(3);
			parseXML('xmlContent.xml','news','header_welcomeTxt','content_welcomeTxt');
			showDivBlock("subnav_newsEvents", "hidden");
			break;	
		case "subnav_events":
			setBtnClicked(3);
			parseXML('xmlContent.xml','events','header_welcomeTxt','content_welcomeTxt');
			showDivBlock("subnav_newsEvents", "hidden");
			Shadowbox.init();
			break;
		case "facilities":
			setBtnClicked(4);
			parseXML('xmlContent.xml','facilities','header_welcomeTxt','content_welcomeTxt');
			break;
		case "testimonials":
			setBtnClicked(5);
			parseXML('xmlContent.xml','testimonials','header_welcomeTxt','content_welcomeTxt');
			break;	
		case "giftvouchers":
			setBtnClicked(6);
			parseXML('xmlContent.xml','giftvouchers','header_welcomeTxt','content_welcomeTxt');
			break;			
		case "faq":
			setBtnClicked(7);
			parseXML('xmlContent.xml','faq','header_welcomeTxt','content_welcomeTxt');
			createForm_tips('form_tips');
			break;				
		case "contact":
			setBtnClicked(8);
			parseXML('xmlContent.xml','contact','header_welcomeTxt','content_welcomeTxt');
			break;	
		//promotion
		case "promotion":
		case "promotion_newUFacial":
			setAllBtnOff();
			parseXML('xmlContent.xml','promotion_newUFacial','header_welcomeTxt','content_welcomeTxt');
			createForm_promotion('form_promotionUFacial');   
			document.getElementById("sg_wrapper").style.width = "483px";
			break;
		case "thankyou_newUFacial":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_newUFacial','header_welcomeTxt','content_welcomeTxt');
			break;			
		case "promotion_bustCare":
			setAllBtnOff();
			parseXML('xmlContent.xml','promotion_bustCare','header_welcomeTxt','content_welcomeTxt');
			//createForm_promotion('form_promotionBustCare');   
			break;	
		//Beauty Tips						
		case "beautyTips":
			setAllBtnOff();
			parseXML('xmlContent.xml','beautyTips','header_welcomeTxt','content_welcomeTxt');
			createForm_tips('form_tips');
			break;																								
		case "consultation":
			setAllBtnOff();
			parseXML('xmlContent.xml','consultation','header_welcomeTxt','content_welcomeTxt');
			createForm_consult('form_consultation');
			document.getElementById("sg_wrapper").style.width = "483px";			
			break;
		case "thankyou_consultation":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_consultation','header_welcomeTxt','content_welcomeTxt');
			break;					
		case "beautyInquiries":
			setAllBtnOff();
			parseXML('xmlContent.xml','beautyInquiries','header_welcomeTxt','content_welcomeTxt');
			createForm_beautyInquiries('form_beautyInquiries');
			document.getElementById("sg_wrapper").style.width = "483px";			
			break;	
		case "thankyou_beautyInquiries":
			setAllBtnOff();
			parseXML('xmlContent.xml','thankyou_beautyInquiries','header_welcomeTxt','content_welcomeTxt');
			break;					
		case "affiliatePartner"://Affiliate Partner
			setAllBtnOff();
			parseXML('xmlContent.xml','affiliatePartner','header_welcomeTxt','content_welcomeTxt');
			break;
		case "bodywellness":
			setAllBtnOff();
			window.open("http://www.bodywellnesssg.com");
			break;
		case "naturesgallery":
			setAllBtnOff();
			window.open("http://www.naturesgallery.com.sg");
			break;
		case "rsa":
			setAllBtnOff();
			window.open("http://www.royalspaacademy.com.sg");
			break;			
		case "policy"://Policy
			setAllBtnOff();
			parseXML('xmlContent.xml','policy','header_welcomeTxt','content_welcomeTxt');
			break;
		case "sitemap"://sitemap
			setAllBtnOff();
			parseXML('xmlContent.xml','sitemap','header_welcomeTxt','content_welcomeTxt');
			break;																		
		default:	
	}
}
//reset all the buttons to off status
function setAllBtnOff(){
	for (var i=0; i<btnObj.length; i++){	
		if (btnObj[i].clickStatus){
			btnObj[i].clickStatus = 0;
			btnObj[i].imgelem.src = btnObj[i].imgOut;
			return;
		}
	}
}
//execute when mouse rollover a button
function doMouseOver(idName){
	if (!(btnObj[findBtnIndx(idName)].clickStatus) && !(btnObj[findBtnIndx(idName)].submenu) ) {
		MM_swapImage(idName,'',btnObj[findBtnIndx(idName)].imgOver,1);
	}
	if (btnObj[findBtnIndx(idName)].submenu){
		var submenu = "subnav_"+idName;
		var oDiv = document.getElementById(submenu);
		oDiv.style.display = "block";
	}

}
//execute when mouse rollout a button
function doMouseOut(idName){
	if (!(btnObj[findBtnIndx(idName)].clickStatus) && !(btnObj[findBtnIndx(idName)].submenu)) 
		MM_swapImgRestore();
	if (btnObj[findBtnIndx(idName)].submenu){
		var submenu = "subnav_"+idName;
		var oDiv = document.getElementById(submenu);
		oDiv.style.display = "none";
	}	
}
//find the array index of a button
function findBtnIndx(idName){
	for (var i=0; i<btnObj.length; i++){
		if (btnObj[i].name == idName)
			return i;
	}
}
//execute when mouse rollout a submenu button
function dosubmenuMouseOver(idName){
	MM_swapImage(idName,'',btnObj[findBtnIndx(idName)].imgOver,1);
}
//execute when mouse rollout a submenu button
function dosubmenuMouseOut(idName){
	MM_swapImgRestore();
}
//preload Images when body on load
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//load a XML file
function loadXMLDoc(filename){
	var xmlDoc=null;
	if (window.ActiveXObject)
	{// code for IE
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	}
	else if (document.implementation.createDocument)
	{// code for Mozilla, Firefox, Opera, etc.
		xmlDoc=document.implementation.createDocument("","",null);
		
	}
	else
	{
		alert('Your browser cannot handle XML document. Please update your browser!');
	}
	
	if (xmlDoc !=null)	
	{
		xmlDoc.async=false;/*parser will not continue execution of the script before the document is fully loaded.*/
		xmlDoc.load(filename);
		return xmlDoc;
	}else
		return null;
}
/*********************************************************
Purpose: XML file reader
Parameters:filename, XML file name
			pageID, which page content to read
			headerID, the DIV's idname for header display
			contentID, the DIV's idname for content display
*********************************************************/
function parseXML(filename,pageID,headerID,contentID)
{

	var xmlDoc = loadXMLDoc(filename);

	//alert(xmlDoc.getElementsByTagName("para")[0].attributes.getNamedItem("indent").nodeValue);
	var pageContent=xmlDoc.getElementsByTagName(pageID);//pageContent.length = 1
	
	//set header's display style
	if (pageContent[0].getElementsByTagName("header")[0].attributes.length > 0){//with attributes
		var divHeader = document.getElementById(headerID);
		var fntSize = pageContent[0].getElementsByTagName("header")[0].attributes.getNamedItem("size").nodeValue;
		var fntColor = pageContent[0].getElementsByTagName("header")[0].attributes.getNamedItem("color").nodeValue;
		var fntFamily = pageContent[0].getElementsByTagName("header")[0].attributes.getNamedItem("fontFamily").nodeValue;
		var paddingTop = pageContent[0].getElementsByTagName("header")[0].attributes.getNamedItem("paddingTop").nodeValue;
		var paddingLeft = pageContent[0].getElementsByTagName("header")[0].attributes.getNamedItem("paddingLeft").nodeValue;

		divHeader.style.fontSize = fntSize;
		divHeader.style.color = fntColor;
		divHeader.style.fontFamily = fntFamily;
		divHeader.style.paddingTop = paddingTop;
		divHeader.style.paddingLeft = paddingLeft;		
	}
	//get header text string
	document.getElementById("header_welcomeTxt").innerHTML = pageContent[0].getElementsByTagName("header")[0].childNodes[0].nodeValue;

	//set content's display style
	if (pageContent[0].getElementsByTagName("content")[0].attributes.length > 0){//with attributes
		var divHeader = document.getElementById(contentID);
		var fntSize = pageContent[0].getElementsByTagName("content")[0].attributes.getNamedItem("size").nodeValue;
		var fntColor = pageContent[0].getElementsByTagName("content")[0].attributes.getNamedItem("color").nodeValue;
		var fntFamily = pageContent[0].getElementsByTagName("content")[0].attributes.getNamedItem("fontFamily").nodeValue;
		var paddingTop = pageContent[0].getElementsByTagName("content")[0].attributes.getNamedItem("paddingTop").nodeValue;
		var paddingLeft = pageContent[0].getElementsByTagName("content")[0].attributes.getNamedItem("paddingLeft").nodeValue;

		divHeader.style.fontSize = fntSize;
		divHeader.style.color = fntColor;
		divHeader.style.fontFamily = fntFamily;
		divHeader.style.paddingTop = paddingTop;
		divHeader.style.paddingLeft = paddingLeft;		
	}		
	//get content text string
	var txtstring="";
	for (var i=0; i<pageContent[0].getElementsByTagName("para").length;i++){
		if (pageContent[0].getElementsByTagName("para")[i].attributes.length > 0){//with attributes
			var indentValue = pageContent[0].getElementsByTagName("para")[i].attributes.getNamedItem("indent").nodeValue;
			if ( indentValue >0){//check the value of indent attribute
				txtstring += "<div style='padding-left:";
				txtstring += indentValue;
				txtstring += "px;'>";
			}
			
		}else{
			txtstring += "<p>";
		}
		//check para childnodes
		for (var j=0; j<pageContent[0].getElementsByTagName("para")[i].childNodes.length; j++){
			
			if (pageContent[0].getElementsByTagName("para")[i].childNodes[j].nodeName == "bold"){
				txtstring += "<b>";
				txtstring += pageContent[0].getElementsByTagName("para")[i].childNodes[j].childNodes[0].nodeValue;
				txtstring += "</b>";
			}else if (pageContent[0].getElementsByTagName("para")[i].childNodes[j].nodeName == "linebreak"){
				txtstring += "<br />";
			}else{
				txtstring += pageContent[0].getElementsByTagName("para")[i].childNodes[j].nodeValue;
			}
		}
		if (indentValue >0){
			txtstring += "</div>";
		}else{
			txtstring += "</p>";
		}
	}
	
	document.getElementById("content_welcomeTxt").innerHTML = txtstring;
		
}
/*********************************************************
Purpose: it is a work around solution for DIV has different display in IE & firefox
Parameters:	idName, the DIV's idname for content display
*********************************************************/
function browserChk(){
	/*var browser=navigator.appName;
	
	if (browser=="Microsoft Internet Explorer"){
		document.getElementById("rightframe").style.top = "-748px";
		document.getElementById("rightframe").style.left = "283px";	
		
		document.getElementById("content_welcomeTxt").style.height = "187px";	

	}
	else{
		document.getElementById("contentArea").style.left = "283px";
			
		document.getElementById("content_welcomeTxt").style.top = "-219px";	
		document.getElementById("content_welcomeTxt").style.height = "203px";	
		document.getElementById("content_welcomeTxt").style.height = "203px";
			
		document.getElementById("header_welcomeTxt").style.left = "-199px";	//283-84		
		
	}*/
	
}
/*********************************************************
Purpose: show on/off a div block
Parameters:	idName, the DIV's idname for content display on/off
*********************************************************/
function showDivBlock(idName, action){
	var oDiv = document.getElementById(idName);
	if (action == "hidden"){
		oDiv.style.display="none";
	}else{
		oDiv.style.display="block";
	}

}
/*********************************************************
Purpose: toggle the display property of a div block
Parameters:	idName, the DIV's idname for content display on/off
*********************************************************/

function toggleDivBlock(idName){
	var oDiv = document.getElementById(idName);
	if (oDiv.style.display == "none"){
		oDiv.style.display="block";
	}else{
		oDiv.style.display="none";
	}

}
/*********************************************************
Purpose: Create a form for consultation
Parameters:	idName, the DIV's idname for content display
*********************************************************/
function createForm_consult(idName){
	var txtstring="";

	txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=YBKNO65XPPPN6UD4NAYND9D785S0OP-123536&quot;' method='post' enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor123536' >";
	txtstring += "<div id='sg_wrapper'>";
	txtstring += "<div id='sg_header'>";
	txtstring += "<div id='sg_header_hook_1'></div>";				       
	txtstring += "<div id='sg_header_hook_2'></div>";
	txtstring += "</div>";			    
	txtstring += "<div id='sg_content'>";
	txtstring += "<div id='sg_content_hook_1'></div>";
	txtstring += "<!-- QUESTIONS INSERTED HERE -->";       
	txtstring += "<div class='sg_QuestionSet'><!-- QS Start -->";
	txtstring += "<div class='sg_Question    sg_EssayWrapper' id='sg_dhtml_q2'  >";
	txtstring += "<input type='hidden' id='hidden_2' name='hidden_2' value='false' />";
	txtstring += "<div class='sg_QuestionTitle'><script type='text/javascript' >var sg_first_number = 1;</script>";
	txtstring += "<span class='qNumber' id='qNumber_2' >1. </span><label for='Q_2' >What are the health problems which have been of great concerns to you?</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "<div class='sg_ControlSet' ><textarea class='sg_Essay sg_Required'  id='Q_2'  name='Q_2'  cols='80'  rows='10'  ></textarea></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";
						
	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q3'  >";
	txtstring += "<input type='hidden' id='hidden_3' name='hidden_3' value='false' />";
	txtstring += "<div class='sg_QuestionTitle'>";
	txtstring += "<span class='qNumber' id='qNumber_3' >2. </span>How difficult has it been to get a solution online?<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "<div class='sg_ControlSet' >";
	txtstring += "<div class='sg_Radio_Options sg_Required' >";
	txtstring += "<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_3'  id='Q_3O0'  title='Very difficult'  value='O0' /></td><td class='sg_TD2' ><label for='Q_3O0' >Very difficult</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_3'  id='Q_3O1'  title='Somehow difficult'  value='O1' /></td><td class='sg_TD2' ><label for='Q_3O1' >Somehow difficult</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_3'  id='Q_3O2'  title='Not that difficult'  value='O2' /></td><td class='sg_TD2' ><label for='Q_3O2' >Not that difficult</label></td></tr>";
	txtstring += "</table>";
	txtstring += "</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";
					
	txtstring += "<div class='sg_Question   sg_EssayWrapper' id='sg_dhtml_q4'  >";
	txtstring += "<input type='hidden' id='hidden_4' name='hidden_4' value='false' />";
	txtstring += "<div class='sg_QuestionTitle'>";
	txtstring += "<span class='qNumber' id='qNumber_4' >3. </span><label for='Q_4' >Are there any other health topics which might be of interest to you?</label></div>";
	txtstring += "<div class='sg_ControlSet' ><textarea class='sg_Essay'  id='Q_4'  name='Q_4'  cols='80'  rows='5'  ></textarea></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";
							
	txtstring += "<div class='sg_Question    sg_GroupWrapper' id='sg_dhtml_q5'  >";
	txtstring += "<input type='hidden' id='hidden_5' name='hidden_5' value='false' />";
	txtstring += "<div class='sg_QuestionTitle'>";
	txtstring += "<span class='qNumber' id='qNumber_5' >4. </span>Please help us with your personal information so that we can bring our best advices to you.</div>";
	txtstring += "<div class='sg_ControlSet' ><div class='sg_Group sg_Group_ContactInfo'>";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_6' >First Name</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div><div class='sg_GroupInput' ><input class='sg_Textbox sg_Required'  name='Q_6'  id='sg_Q_6'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_6_msg' >&nbsp;</span></div></div>";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_7' >Last Name</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div><div class='sg_GroupInput' ><input class='sg_Textbox sg_Required'  name='Q_7'  id='sg_Q_7'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_7_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_10' >Home Address</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div><div class='sg_GroupInput' ><input class='sg_Textbox sg_Required'  name='Q_10'  id='sg_Q_10'  value='' size='60' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_10_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_14' >Postal Code</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div><div class='sg_GroupInput' ><input class='sg_Textbox sg_Required'  name='Q_14'  id='sg_Q_14'  value='' size='8' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_14_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_15' >Country</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div><div class='sg_GroupInput' ><input class='sg_Textbox sg_Required'  name='Q_15'  id='sg_Q_15'  value='' size='15' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_15_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_16' >Email Address</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div><div class='sg_GroupInput' ><input class='sg_Textbox sg_Required'  name='Q_16'  id='sg_Q_16'  value='' size='45' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_16_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_19' >Mobile Phone</label><span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div><div class='sg_GroupInput' ><input class='sg_Textbox sg_Required'  name='Q_19'  id='sg_Q_19'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_19_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "<div class='sg_GroupItem' >";
	txtstring += "<div class='sg_GroupLabel' ><label for='sg_Q_20' >URL (optional)</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_20'  id='sg_Q_20'  value='' size='45' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_20_msg' >&nbsp;</span></div></div><br clear='all' /></div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";							
	txtstring += "<!-- QS End --></div>";
	txtstring += "<br clear='all' />";
	txtstring += "<div class='sg_Button_Group'>";
	txtstring += "<input type='submit' class='sg_Submit' id='sg_SubmitButton' name='sGizmoSubmitButton' value='Submit My Questions Now!' />";
	txtstring += "</div>";				        
	txtstring += "<div id='sg_content_hook_2'></div>";
	txtstring += "</div>";				
	txtstring += "<div id='sg_footer'>";        
	txtstring += "<div id='sg_footer_hook_1'></div>";
	txtstring += "<div id='sg_footer_hook_2'></div>";
	txtstring += "</div>";
	txtstring += "</div>";				
	txtstring += "<input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_2,Q_3,Q_4,5,Q_6,Q_7,Q_10,Q_14,Q_15,Q_16,Q_19,Q_20' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1239334721' /></form>";
	txtstring += "<div style='color:black;font:normal 10px/12px arial;margin-top:20px;' class='sg_PoweredBy' ><a href='http://www.surveygizmo.com/?ap=sg4&img=t'  target='_blank' ><img src='images/underTheHood.gif' alt='Online Survey Software' border='0' /></a><br /><a href='http://www.surveygizmo.com/?ap=sg4'  target='_blank'  style='color:black;font-size:9px;white-space:nowrap'>Online Surveys</a> powered by SurveyGizmo </div>";				
		
	document.getElementById(idName).innerHTML = txtstring;
}
/*********************************************************
Purpose: Create a form for promotion
Parameters:	idName, the DIV's idname for content display
*********************************************************/
function createForm_promotion(idName){
	var txtstring="";
    if (idName == "form_promotionUFacial"){
		txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=K40765HDFC5VKU1IWEINPPXP58EB68-143418&quot; ' method='post'  enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor143418' >";
	}else if (idName == "form_servicesMenFacial"){
		txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=6Q5VZ786C02H9ALKH0WBYFM56YK569-150649&quot; ' method='post'  enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor150649' >";
	}else if (idName == "form_IPL"){
		txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=LAFNV2K2NNRD0RGCJ8ESF6MM054018-189823' method='post'  enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor189823' >";
	}

	txtstring += "  <div id='sg_wrapper'>";
	txtstring += "      <div id='sg_content'>";
	txtstring += "         <!-- QUESTIONS INSERTED HERE -->";
	txtstring += "         	<div class='sg_QuestionSet'><!-- QS Start -->";
	txtstring += "  			<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q2'  >";
	txtstring += "  				<input type='hidden' id='hidden_2' name='hidden_2' value='false' />";
	txtstring += "  				<div class='sg_QuestionTitle'><script type='text/javascript' >var sg_first_number = 1;</script>";
	txtstring += "  					<span class='qNumber' id='qNumber_2' >1. </span>What is the best time to call you?</div>";
	txtstring += "  				<div class='sg_ControlSet' >";
	txtstring += "  				<div class='sg_Radio_Options' >";
	txtstring += "  					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O0'  title='Morning'  value='O0' /></td><td class='sg_TD2' ><label for='Q_2O0' >Morning</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O1'  title='Afternoon'  value='O1' /></td><td class='sg_TD2' ><label for='Q_2O1' >Afternoon</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O2'  title='Evening'  value='O2' /></td><td class='sg_TD2' ><label for='Q_2O2' >Evening</label></td></tr>";
	txtstring += "  					</table>";
	txtstring += "  				</div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += "  			</div>";
	txtstring += "  			<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q3'  >";
	txtstring += " 				<input type='hidden' id='hidden_3' name='hidden_3' value='false' />";
	txtstring += "  				<div class='sg_QuestionTitle'>";
	txtstring += "  					<span class='qNumber' id='qNumber_3' >2. </span>What is your gender?</div>";
	txtstring += "  				<div class='sg_ControlSet' >";
	txtstring += "  				<div class='sg_Radio_Options' >";
	txtstring += "  					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_3'  id='Q_3O0'  title='Male'  value='O0' /></td><td class='sg_TD2' ><label for='Q_3O0' >Male</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_3'  id='Q_3O1'  title='Female'  value='O1' /></td><td class='sg_TD2' ><label for='Q_3O1' >Female</label></td></tr>";
	txtstring += "  					</table>";
	txtstring += "  				</div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += "  			</div>";
	txtstring += "  			<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q4'  >";
	txtstring += "  				<input type='hidden' id='hidden_4' name='hidden_4' value='false' />";
	txtstring += " 					<div class='sg_QuestionTitle'>";
	txtstring += "  					<span class='qNumber' id='qNumber_4' >3. </span>What is your age group?</div>";
	txtstring += "  				<div class='sg_ControlSet' >";
	txtstring += "  				<div class='sg_Radio_Options' >";
	txtstring += "  					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O0'  title='Below 18'  value='O0' /></td><td class='sg_TD2' ><label for='Q_4O0' >Below 18</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O1'  title='18~25'  value='O1' /></td><td class='sg_TD2' ><label for='Q_4O1' >18~25</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O2'  title='26~35'  value='O2' /></td><td class='sg_TD2' ><label for='Q_4O2' >26~35</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O3'  title='36~45'  value='O3' /></td><td class='sg_TD2' ><label for='Q_4O3' >36~45</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O4'  title='46~55'  value='O4' /></td><td class='sg_TD2' ><label for='Q_4O4' >46~55</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O5'  title='55~60'  value='O5' /></td><td class='sg_TD2' ><label for='Q_4O5' >55~60</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O6'  title='Above 60'  value='O6' /></td><td class='sg_TD2' ><label for='Q_4O6' >Above 60</label></td></tr>";
	txtstring += "  					</table>";
	txtstring += "  				</div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += " 				</div>";
	txtstring += "  			<div class='sg_Question    sg_GroupWrapper' id='sg_dhtml_q5'  >";
	txtstring += "  				<input type='hidden' id='hidden_5' name='hidden_5' value='false' />";
	txtstring += "  				<div class='sg_QuestionTitle'>";
	txtstring += "  					<span class='qNumber' id='qNumber_5' >4. </span>Please fill in your particulars so that we can arrange for an appointment with you.</div>";
	txtstring += "  				<div class='sg_ControlSet' ><div class='sg_Group sg_Group_ContactInfo'>";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_6' >First Name</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_6'  id='sg_Q_6'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_6_msg' >&nbsp;</span></div></div>";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_7' >Surname</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_7'  id='sg_Q_7'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_7_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_15' >Country</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_15'  id='sg_Q_15'  value='' size='15' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_15_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_16' >Email Address</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_16'  id='sg_Q_16'  value='' size='45' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_16_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_19' >Mobile Phone</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_19'  id='sg_Q_19'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_19_msg' >&nbsp;</span></div></div><br clear='all' /><br clear='all' /></div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += "  			</div>";
	txtstring += "  		</div><!-- QS End -->";
	txtstring += "         <br clear='all' />";
	txtstring += "  	   <div class='sg_Button_Group'>";
    if (idName == "form_promotionUFacial" || idName == "form_servicesMenFacial"){
		txtstring += "            <input type='submit' class='sg_Submit' id='sg_SubmitButton' name='sGizmoSubmitButton' value='Yes, please call me up for an appointment!' />";
	}else if (idName == "form_IPL"){
		txtstring += "            <input type='submit' class='sg_Submit' id='sg_SubmitButton' name='sGizmoSubmitButton' value='Yes, I want this complimentary consultation!' />";
	}	
	txtstring += "  	   </div>";
	txtstring += "      </div><!-- sg_content -->";
	txtstring += "      <div id='sg_footer'>";
	txtstring += "          <div id='sg_footer_hook_1'></div>";
	txtstring += "          <div id='sg_footer_hook_2'></div>";
	txtstring += "      </div>";
	txtstring += "  </div><!-- sg_wrapper -->";
    if (idName == "form_promotionUFacial"){
		txtstring += "  <input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_2,Q_3,Q_4,5,Q_6,Q_7,Q_15,Q_16,Q_19' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1241232636' /></form>";
	}else if (idName == "form_servicesMenFacial"){
		txtstring += "  <input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_2,Q_3,Q_4,5,Q_6,Q_7,Q_15,Q_16,Q_19' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1245938779' /></form>";
	}else if (idName == "form_IPL"){
		txtstring += "  <input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_2,Q_3,Q_4,5,Q_6,Q_7,Q_15,Q_16,Q_19' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1255231046' /></form>";
	}		
	txtstring += "  <div style='color:black;font:normal 10px/12px arial;margin-top:20px;' class='sg_PoweredBy'><a href='http://www.surveygizmo.com/?ap=sg4&img=t'  target='_blank' ><img src='images/underTheHood.gif' alt='Online Survey Software' border='0' /></a><br /><a href='http://www.surveygizmo.com/?ap=sg4'  target='_blank'  style='color:black;font-size:9px;white-space:nowrap'>Online Surveys</a> powered by SurveyGizmo </div>";             
		            
	document.getElementById(idName).innerHTML = txtstring;
}        
/*********************************************************
Purpose: Create a form for promotion
Parameters:	idName, the DIV's idname for content display
*********************************************************/
function createForm_services(idName){
	var txtstring="";
    if (idName == "form_promotionBustCare"){
		txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=060P570CEBM67E1ZPE58ZBO7FJDRZM-143423' method='post'  enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor143423' >";
	}else if (idName == "form_servicesBeauty"){
		txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=GJNRRK1M1M6585QUDZDP0O2MBRM7HT-188875' method='post'  enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor188875' >";
	}else if (idName == "form_servicesHairSpa"){
		txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=B8NZCW5VHPN5JX0ZVJ2CZ2NKQRQL4S-143421' method='post'  enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor143421' >";
	}

	txtstring += "  <div id='sg_wrapper'>";
	txtstring += "      <div id='sg_content'>";
	txtstring += "         <!-- QUESTIONS INSERTED HERE -->";
	txtstring += "         	<div class='sg_QuestionSet'><!-- QS Start -->";
	txtstring += "         	<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q22'  >";
	txtstring += "         	<input type='hidden' id='hidden_22' name='hidden_22' value='false' />";
	txtstring += "         		<div class='sg_QuestionTitle'><script type='text/javascript' >var sg_first_number = 1;</script>";
	txtstring += "         			<span class='qNumber' id='qNumber_22' >1. </span>Select Your Preferred Treatment.</div>";
	txtstring += "         		<div class='sg_ControlSet' >";
	txtstring += "         		<div class='sg_Radio_Options' >";
    if (idName == "form_promotionBustCare"){
		txtstring += "         			<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' id='option_Q_22_O0'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O0'  title='Perfect Bust Booster &nbsp;&nbsp;'  value='O0' /></td><td class='sg_TD2' ><label for='Q_22O0' >Perfect Bust Booster   </label></td></tr><tr class='noFlicker' id='option_Q_22_O1'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O1'  title='Womanly Blossom &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'  value='O1' /></td><td class='sg_TD2' ><label for='Q_22O1' >Womanly Blossom       </label></td></tr>";
	}else if (idName == "form_servicesBeauty"){
		txtstring += "					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' id='option_Q_22_O0'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O0'  title='Wonder Silk Rejuvenation&nbsp;'  value='O0' /></td><td class='sg_TD2' ><label for='Q_22O0' >Wonder Silk Rejuvenation </label></td></tr><tr class='noFlicker' id='option_Q_22_O1'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O1'  title='Anti-Aging/Anti-Acne Signature Treatment &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'  value='O1' /></td><td class='sg_TD2' ><label for='Q_22O1' >Anti-Aging/Anti-Acne Signature Treatment       </label></td></tr><tr class='noFlicker' id='option_Q_22_O3'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O3'  title='Cellureen Facial Treatment'  value='O3' /></td><td class='sg_TD2' ><label for='Q_22O3' >Cellureen Facial Treatment</label></td></tr><tr class='noFlicker' id='option_Q_22_O4'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O4'  title='Cellureen Ultimate Face Lift'  value='O4' /></td><td class='sg_TD2' ><label for='Q_22O4' >Cellureen Ultimate Face Lift</label></td></tr><tr class='noFlicker' id='option_Q_22_O5'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O5'  title='Cellureen Perfect Eye Lift Treatment'  value='O5' /></td><td class='sg_TD2' ><label for='Q_22O5' >Cellureen Perfect Eye Lift Treatment</label></td></tr>";
	}else if (idName == "form_servicesHairSpa"){
		txtstring += "					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' id='option_Q_22_O0'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O0'  title='Royal Purifying &amp; Hydrating Treatment'  value='O0' /></td><td class='sg_TD2' ><label for='Q_22O0' >Royal Purifying & Hydrating Treatment</label></td></tr><tr class='noFlicker' id='option_Q_22_O1'><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_22'  id='Q_22O1'  title='Royal Hair Relaxation Spa Treatment'  value='O1' /></td><td class='sg_TD2' ><label for='Q_22O1' >Royal Hair Relaxation Spa Treatment</label></td></tr>";
	}
	txtstring += "         			</table>";
	txtstring += "         		</div></div>";
	txtstring += "         	<div class='sg_Question_Footer'></div>";
	txtstring += "         	</div>";
	txtstring += "  			<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q2'  >";
	txtstring += "  				<input type='hidden' id='hidden_2' name='hidden_2' value='false' />";
	txtstring += "  				<div class='sg_QuestionTitle'><script type='text/javascript' >var sg_first_number = 1;</script>";
	txtstring += "  					<span class='qNumber' id='qNumber_2' >2. </span>What is the best time to call you?</div>";
	txtstring += "  				<div class='sg_ControlSet' >";
	txtstring += "  				<div class='sg_Radio_Options' >";
	txtstring += "  					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O0'  title='Morning'  value='O0' /></td><td class='sg_TD2' ><label for='Q_2O0' >Morning</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O1'  title='Afternoon'  value='O1' /></td><td class='sg_TD2' ><label for='Q_2O1' >Afternoon</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O2'  title='Evening'  value='O2' /></td><td class='sg_TD2' ><label for='Q_2O2' >Evening</label></td></tr>";
	txtstring += "  					</table>";
	txtstring += "  				</div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += "  			</div>";
	txtstring += "  			<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q3'  >";
	txtstring += " 				<input type='hidden' id='hidden_3' name='hidden_3' value='false' />";
	txtstring += "  				<div class='sg_QuestionTitle'>";
	txtstring += "  					<span class='qNumber' id='qNumber_3' >3. </span>What is your gender?</div>";
	txtstring += "  				<div class='sg_ControlSet' >";
	txtstring += "  				<div class='sg_Radio_Options' >";
	txtstring += "  					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_3'  id='Q_3O0'  title='Male'  value='O0' /></td><td class='sg_TD2' ><label for='Q_3O0' >Male</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_3'  id='Q_3O1'  title='Female'  value='O1' /></td><td class='sg_TD2' ><label for='Q_3O1' >Female</label></td></tr>";
	txtstring += "  					</table>";
	txtstring += "  				</div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += "  			</div>";
	txtstring += "  			<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q4'  >";
	txtstring += "  				<input type='hidden' id='hidden_4' name='hidden_4' value='false' />";
	txtstring += " 					<div class='sg_QuestionTitle'>";
	txtstring += "  					<span class='qNumber' id='qNumber_4' >4. </span>What is your age group?</div>";
	txtstring += "  				<div class='sg_ControlSet' >";
	txtstring += "  				<div class='sg_Radio_Options' >";
	txtstring += "  					<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O0'  title='Below 18'  value='O0' /></td><td class='sg_TD2' ><label for='Q_4O0' >Below 18</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O1'  title='18~25'  value='O1' /></td><td class='sg_TD2' ><label for='Q_4O1' >18~25</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O2'  title='26~35'  value='O2' /></td><td class='sg_TD2' ><label for='Q_4O2' >26~35</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O3'  title='36~45'  value='O3' /></td><td class='sg_TD2' ><label for='Q_4O3' >36~45</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O4'  title='46~55'  value='O4' /></td><td class='sg_TD2' ><label for='Q_4O4' >46~55</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O5'  title='55~60'  value='O5' /></td><td class='sg_TD2' ><label for='Q_4O5' >55~60</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O6'  title='Above 60'  value='O6' /></td><td class='sg_TD2' ><label for='Q_4O6' >Above 60</label></td></tr>";
	txtstring += "  					</table>";
	txtstring += "  				</div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += " 				</div>";
	txtstring += "  			<div class='sg_Question    sg_GroupWrapper' id='sg_dhtml_q5'  >";
	txtstring += "  				<input type='hidden' id='hidden_5' name='hidden_5' value='false' />";
	txtstring += "  				<div class='sg_QuestionTitle'>";
	txtstring += "  					<span class='qNumber' id='qNumber_5' >5. </span>Please fill in your particulars so that we can arrange for an appointment with you.</div>";
	txtstring += "  				<div class='sg_ControlSet' ><div class='sg_Group sg_Group_ContactInfo'>";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_6' >First Name</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_6'  id='sg_Q_6'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_6_msg' >&nbsp;</span></div></div>";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_7' >Surname</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_7'  id='sg_Q_7'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_7_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_15' >Country</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_15'  id='sg_Q_15'  value='' size='15' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_15_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_16' >Email Address</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_16'  id='sg_Q_16'  value='' size='45' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_16_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "  					<div class='sg_GroupItem ' >";
	txtstring += "  						<div class='sg_GroupLabel' ><label for='sg_Q_19' >Mobile Phone</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_19'  id='sg_Q_19'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_19_msg' >&nbsp;</span></div></div><br clear='all' /><br clear='all' /></div></div>";
	txtstring += "  				<div class='sg_Question_Footer'></div>";
	txtstring += "  			</div>";
	txtstring += "  		</div><!-- QS End -->";
	txtstring += "         <br clear='all' />";
	txtstring += "  	   <div class='sg_Button_Group'>";
	txtstring += "            <input type='submit' class='sg_Submit' id='sg_SubmitButton' name='sGizmoSubmitButton' value='Yes, please call me up for an appointment!' />";
	txtstring += "  	   </div>";
	txtstring += "      </div><!-- sg_content -->";
	txtstring += "      <div id='sg_footer'>";
	txtstring += "          <div id='sg_footer_hook_1'></div>";
	txtstring += "          <div id='sg_footer_hook_2'></div>";
	txtstring += "      </div>";
	txtstring += "  </div><!-- sg_wrapper -->";
    if (idName == "form_promotionBustCare"){
		txtstring += "  <input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_22,Q_2,Q_3,Q_4,5,Q_6,Q_7,Q_15,Q_16,Q_19' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1255010813' /></form>";
	}else if (idName == "form_servicesBeauty"){
		txtstring += "  <input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_22,Q_2,Q_3,Q_4,5,Q_6,Q_7,Q_15,Q_16,Q_19' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1255011707' /></form>";
	}else if (idName == "form_servicesHairSpa"){
		txtstring += "	<input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_22,Q_2,Q_3,Q_4,5,Q_6,Q_7,Q_15,Q_16,Q_19' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1255010391' /></form>";
	}
	txtstring += "  <div style='color:black;font:normal 10px/12px arial;margin-top:20px;' class='sg_PoweredBy' ><a href='http://www.surveygizmo.com/?ap=sg4&img=t'  target='_blank' ><img src='images/underTheHood.gif' alt='Online Survey Software' border='0' /></a><br /><a href='http://www.surveygizmo.com/?ap=sg4'  target='_blank'  style='color:black;font-size:9px;white-space:nowrap'>Online Surveys</a> powered by SurveyGizmo </div>";             
		            
	document.getElementById(idName).innerHTML = txtstring;
}              
/*********************************************************
Purpose: Create a form for tips form
Parameters:	idName, the DIV's idname for content display
*********************************************************/
function createForm_tips(idName){
	var txtstring="";
	txtstring += "<center><form method='post' action='http://www.aweber.com/scripts/addlead.pl'>";
	txtstring += "<input type='hidden' name='meta_web_form_id' value='1111359886'>";
	txtstring += "<input type='hidden' name='meta_split_id' value=''>";
	txtstring += "<input type='hidden' name='unit' value='ng_beauty_tips'>";
	txtstring += "<input type='hidden' name='redirect' value='http://www.naturesgallery.com.sg/beauty-tips-thank-you.html' id='redirect_6174e4acd658d95d730ae3466fa08f9e'>";
	txtstring += "<input type='hidden' name='meta_redirect_onlist' value=''>";
	txtstring += "<input type='hidden' name='meta_adtracking' value=''>";
	txtstring += "<input type='hidden' name='meta_message' value='1'>";
	txtstring += "<input type='hidden' name='meta_required' value='from'>";
	txtstring += "<input type='hidden' name='meta_forward_vars' value='0'>";
	txtstring += "<table cellspacing='5'>";
	txtstring += "<tr><td colspan=2><div><strong>If you want to stay ahead with our latest beauty tips, pls subscribe to our mailing list below. </strong></div></td></tr>";
	txtstring += "<tr><td align='right'>First Name*:</td><td><input type='text' name='name' value='' size='20'></td></tr>";
	txtstring += "<tr><td align='right'>Surname*:</td><td><input type='text' name='custom Surname' value='' size='20'></td></tr>";
	txtstring += "<tr><td align='right'>Email*:</td><td><input type='text' name='from' value='' size='20'></td></tr>";
	txtstring += "<tr><td align='right'>Country*:</td><td><input type='text' name='custom Country' value='' size='20'></td></tr>";
	txtstring += "    <tr><td colspan=2><div><em>We hate spams as much as you do and we will never give away your info without your permission!</em></div></td></tr>";
	txtstring += "<tr><td align='center' colspan='2'><input type='submit' name='submit' value='Join Now!'></td></tr>";
	txtstring += "</table>";
	txtstring += "</form>";
					
	txtstring += "<img src='http://forms.aweber.com/form/displays.htm?id=jIyMjMysnBwcbA==' border='0' />";
	txtstring += "</center>";
	
	document.getElementById(idName).innerHTML = txtstring;
}        
                    
 /*********************************************************
Purpose: Create a form for tips form
Parameters:	idName, the DIV's idname for content display
*********************************************************/
function createForm_beautyInquiries(idName){
	var txtstring="";
	
	txtstring += "<form action='http://app.sgizmo.com/s/passme.php?id=EO67A4UID0ZPYUPPGTCCRJFR1RQ51F-150629&quot; ' method='post'  enctype='multipart/form-data' class='sg_Survey_Form' id='sg_FormFor150629' >";
	txtstring += "<div id='sg_wrapper'>";
	txtstring += "    <div id='sg_header'>";
	txtstring += "       <div id='sg_header_hook_1'></div>";    
	txtstring += "       <div id='sg_header_hook_2'></div>";
	txtstring += "    </div>";
	txtstring += "    <div id='sg_content'>";
	txtstring += "        <div id='sg_content_hook_1'></div>";
	txtstring += "<!-- QUESTIONS INSERTED HERE -->"; 
	txtstring += "<div class='sg_QuestionSet'><!-- QS Start -->";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q2'  >";
	txtstring += "<input type='hidden' id='hidden_2' name='hidden_2' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'><script type='text/javascript' >var sg_first_number = 1;</script>";
	txtstring += "		<span class='qNumber' id='qNumber_2' >1. </span>How would you describe your skin type?<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O0'  title='Dry'  value='O0' /></td><td class='sg_TD2' ><label for='Q_2O0' >Dry</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O1'  title='Sensitive'  value='O1' /></td><td class='sg_TD2' ><label for='Q_2O1' >Sensitive</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O2'  title='Normal'  value='O2' /></td><td class='sg_TD2' ><label for='Q_2O2' >Normal</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O3'  title='Combination'  value='O3' /></td><td class='sg_TD2' ><label for='Q_2O3' >Combination</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O4'  title='Oily'  value='O4' /></td><td class='sg_TD2' ><label for='Q_2O4' >Oily</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O5'  title='Acne-prone'  value='O5' /></td><td class='sg_TD2' ><label for='Q_2O5' >Acne-prone</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_2'  id='Q_2O6'  title='Rosacea'  value='O6' /></td><td class='sg_TD2' ><label for='Q_2O6' >Rosacea</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q3'  >";
	txtstring += "<input type='hidden' id='hidden_3' name='hidden_3' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_3' >2. </span>What are your biggest skin concerns? (Pick up to two choices)<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "   <div class='sg_Checkbox_Options sg_Required' >";
	txtstring += "   	<table class='sg_Table' cellspacing='0' >";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O0'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O0'  id='Q_3_O0'  title='Fine-lines and wrinkles'  value='Fine-lines and wrinkles' /></td><td class='sg_TD2' ><label for='Q_3_O0' >Fine-lines and wrinkles</label></td></tr>";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O1'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O1'  id='Q_3_O1'  title='Dry Skin'  value='Dry Skin' /></td><td class='sg_TD2' ><label for='Q_3_O1' >Dry Skin</label></td></tr>";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O2'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O2'  id='Q_3_O2'  title='Uneven skin tone'  value='Uneven skin tone' /></td><td class='sg_TD2' ><label for='Q_3_O2' >Uneven skin tone</label></td></tr>";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O3'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O3'  id='Q_3_O3'  title='Oiliness'  value='Oiliness' /></td><td class='sg_TD2' ><label for='Q_3_O3' >Oiliness</label></td></tr>";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O4'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O4'  id='Q_3_O4'  title='Blackheads'  value='Blackheads' /></td><td class='sg_TD2' ><label for='Q_3_O4' >Blackheads</label></td></tr>";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O5'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O5'  id='Q_3_O5'  title='Large pores'  value='Large pores' /></td><td class='sg_TD2' ><label for='Q_3_O5' >Large pores</label></td></tr>";
	txtstring += "  		<tr class='noFlicker' id='option_Q_3_O6'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O6'  id='Q_3_O6'  title='Acne'  value='Acne' /></td><td class='sg_TD2' ><label for='Q_3_O6' >Acne</label></td></tr>";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O7'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O7'  id='Q_3_O7'  title='Age spots'  value='Age spots' /></td><td class='sg_TD2' ><label for='Q_3_O7' >Age spots</label></td></tr>";
	txtstring += "   		<tr class='noFlicker' id='option_Q_3_O8'  ><td class='sg_TD1' ><input class='sg_Checkbox'  type='checkbox'  name='Q_3_O8'  id='Q_3_O8'  title='Post-acne marks'  value='Post-acne marks' /></td><td class='sg_TD2' ><label for='Q_3_O8' >Post-acne marks</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q4'  >";
	txtstring += "<input type='hidden' id='hidden_4' name='hidden_4' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_4' >3. </span>What's the best description of how your skin reacts to the sun?<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O0'  title='Burns'  value='O0' /></td><td class='sg_TD2' ><label for='Q_4O0' >Burns</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O1'  title='Burns, and then tans'  value='O1' /></td><td class='sg_TD2' ><label for='Q_4O1' >Burns, and then tans</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_4'  id='Q_4O2'  title='Tans'  value='O2' /></td><td class='sg_TD2' ><label for='Q_4O2' >Tans</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q5'  >";
	txtstring += "<input type='hidden' id='hidden_5' name='hidden_5' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_5' >4. </span>How often do you experience breakouts?<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_5'  id='Q_5O0'  title='Almost never'  value='O0' /></td><td class='sg_TD2' ><label for='Q_5O0' >Almost never</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_5'  id='Q_5O1'  title='Occasionally'  value='O1' /></td><td class='sg_TD2' ><label for='Q_5O1' >Occasionally</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_5'  id='Q_5O2'  title='Often'  value='O2' /></td><td class='sg_TD2' ><label for='Q_5O2' >Often</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_5'  id='Q_5O3'  title='Most of the time'  value='O3' /></td><td class='sg_TD2' ><label for='Q_5O3' >Most of the time</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q6'  >";
	txtstring += "<input type='hidden' id='hidden_6' name='hidden_6' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_6' >5. </span>How would you best describe your pore size? <span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_6'  id='Q_6O0'  title='Invisible/small'  value='O0' /></td><td class='sg_TD2' ><label for='Q_6O0' >Invisible/small</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_6'  id='Q_6O1'  title='Larger pores in t-zone'  value='O1' /></td><td class='sg_TD2' ><label for='Q_6O1' >Larger pores in t-zone</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_6'  id='Q_6O2'  title='Large, noticeable pores'  value='O2' /></td><td class='sg_TD2' ><label for='Q_6O2' >Large, noticeable pores</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question    sg_GroupWrapper' id='sg_dhtml_q7'  >";
	txtstring += "<input type='hidden' id='hidden_7' name='hidden_7' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_7' >6. </span>You may be contacted at</div>";
	txtstring += "	<div class='sg_ControlSet' ><div class='sg_Group sg_Group_ContactInfo'>";
	txtstring += "		<div class='sg_GroupItem ' >";
	txtstring += "			<div class='sg_GroupLabel' ><label for='sg_Q_8' >First Name</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_8'  id='sg_Q_8'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_8_msg' >&nbsp;</span></div></div>";
	txtstring += "		<div class='sg_GroupItem ' >";
	txtstring += "			<div class='sg_GroupLabel' ><label for='sg_Q_9' >Last Name</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_9'  id='sg_Q_9'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_9_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "		<div class='sg_GroupItem ' >";
	txtstring += "			<div class='sg_GroupLabel' ><label for='sg_Q_12' >Address</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_12'  id='sg_Q_12'  value='' size='45' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_12_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "		<div class='sg_GroupItem ' >";
	txtstring += "			<div class='sg_GroupLabel' ><label for='sg_Q_13' ></label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_13'  id='sg_Q_13'  value='' size='45' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_13_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "		<div class='sg_GroupItem ' >";
	txtstring += "			<div class='sg_GroupLabel' ><label for='sg_Q_16' >Postal Code</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_16'  id='sg_Q_16'  value='' size='8' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_16_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "		<div class='sg_GroupItem ' >";
	txtstring += "			<div class='sg_GroupLabel' ><label for='sg_Q_18' >Email Address</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_18'  id='sg_Q_18'  value='' size='45' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_18_msg' >&nbsp;</span></div></div><br clear='all' />";
	txtstring += "		<div class='sg_GroupItem ' >";
	txtstring += "			<div class='sg_GroupLabel' ><label for='sg_Q_19' >Contact Number</label></div><div class='sg_GroupInput' ><input class='sg_Textbox'  name='Q_19'  id='sg_Q_19'  value='' size='25' /><span class='sgValidationMessage' style='display:none;' id='sg_Q_19_msg' >&nbsp;</span></div></div><br clear='all' /><br clear='all' /></div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q23'  >";
	txtstring += "<input type='hidden' id='hidden_23' name='hidden_23' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_23' >7. </span>Gender<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_23'  id='Q_23O0'  title='Male'  value='O0' /></td><td class='sg_TD2' ><label for='Q_23O0' >Male</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_23'  id='Q_23O1'  title='Female'  value='O1' /></td><td class='sg_TD2' ><label for='Q_23O1' >Female</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q24'  >";
	txtstring += "<input type='hidden' id='hidden_24' name='hidden_24' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_24' >8. </span>Age<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_24'  id='Q_24O0'  title='13-18'  value='O0' /></td><td class='sg_TD2' ><label for='Q_24O0' >13-18</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_24'  id='Q_24O1'  title='19-25'  value='O1' /></td><td class='sg_TD2' ><label for='Q_24O1' >19-25</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_24'  id='Q_24O2'  title='26-40'  value='O2' /></td><td class='sg_TD2' ><label for='Q_24O2' >26-40</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_24'  id='Q_24O3'  title='40+'  value='O3' /></td><td class='sg_TD2' ><label for='Q_24O3' >40+</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";
	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q25'  >";
	txtstring += "<input type='hidden' id='hidden_25' name='hidden_25' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_25' >9. </span>Please call me at Monday to Saturday<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_25'  id='Q_25O0'  title='Morning'  value='O0' /></td><td class='sg_TD2' ><label for='Q_25O0' >Morning</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_25'  id='Q_25O1'  title='Afternoon'  value='O1' /></td><td class='sg_TD2' ><label for='Q_25O1' >Afternoon</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_25'  id='Q_25O2'  title='Evening'  value='O2' /></td><td class='sg_TD2' ><label for='Q_25O2' >Evening</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<div class='sg_Question   sg_RadioWrapper' id='sg_dhtml_q26'  >";
	txtstring += "<input type='hidden' id='hidden_26' name='hidden_26' value='false' />";
	txtstring += "	<div class='sg_QuestionTitle'>";
	txtstring += "		<span class='qNumber' id='qNumber_26' >10. </span>My preferred location<span class='sg_RequiredAsterix' ><img src='images/req.gif' alt=' Required Question' /></span></div>";
	txtstring += "	<div class='sg_ControlSet' >";
	txtstring += "	<div class='sg_Radio_Options sg_Required' >";
	txtstring += "		<table class='sg_Table' cellspacing='0' ><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_26'  id='Q_26O0'  title='Stamford Court'  value='O0' /></td><td class='sg_TD2' ><label for='Q_26O0' >Stamford Court</label></td></tr><tr class='noFlicker' ><td class='sg_TD1' ><input class='sg_Radio' type='radio'  name='Q_26'  id='Q_26O1'  title='Heritage Court'  value='O1' /></td><td class='sg_TD2' ><label for='Q_26O1' >Heritage Court</label></td></tr>";
	txtstring += "		</table>";
	txtstring += "	</div></div>";
	txtstring += "<div class='sg_Question_Footer'></div>";
	txtstring += "</div>";

	txtstring += "<!-- QS End --></div><script type='text/javascript' >";
	txtstring += "//<![CDATA[ ";
	txtstring += "        function sg$(id){return(document.getElementById(id));}";
	txtstring += "        if(typeof $ != 'function'){";
	txtstring += "        function $(id){return(sg$(id));}";
	txtstring += "        }";
	txtstring += "        function attachEventListener(target, eventType, functionRef, capture){if(typeof target.addEventListener != 'undefined'){target.addEventListener(eventType,functionRef,capture);} else if(typeof target.attachEvent != 'undefined'){target.attachEvent('on' + eventType,functionRef);};}";
	txtstring += "function sgjsGetEventTarget(event){var targetElement = null;if(typeof event.target != 'undefined'){targetElement = event.target;} else {targetElement = event.srcElement};while(targetElement.nodeType == 3 && targetElement.parentNode != null){targetElement = targetElement.parentNode;};return targetElement;}";
	txtstring += "if(typeof getEventTarget != 'function'){getEventTarget = sgjsGetEventTarget;}";		
	txtstring += "function sgjsAddError(elementid,id,message)";
	txtstring += "{";
	txtstring += "        sgjsRemoveError(elementid,id);";
	txtstring += "        eval('if( typeof errors_' + elementid + ' == 'undefined')errors_' + elementid + ' = Array();');";
	txtstring += "        var error = Array();";
	txtstring += "        error[0] = id;";
	txtstring += "        error[1] = message;";
	txtstring += "        eval('errors_' + elementid + '.push(error);');";
	txtstring += "        if( typeof total_errors == 'undefined')total_errors = 0;";
	txtstring += "        total_errors++;      ";
	txtstring += "}";

	txtstring += " function sgjsRemoveError(elementid,id)";
	txtstring += " {";
	txtstring += "        eval('if( typeof errors_' + elementid + ' == 'undefined')errors_' + elementid + ' = Array();');";
	txtstring += "        eval('var array = errors_' + elementid + ';'); ";
	txtstring += "        if(array == 'undefined') return;";
	txtstring += "        var newarray = Array();";       
	txtstring += "        for(var sg_i = 0; sg_i < array.length;sg_i++)";
	txtstring += "        {";
	txtstring += "            if(array[sg_i][0] != id)newarray.push(array[sg_i]);";
	txtstring += "            else {total_errors--;}";
	txtstring += "        } ";
	txtstring += "        eval('errors_' + elementid + ' = newarray;'); ";        
	txtstring += "}";
    
	txtstring += "    function sgjsErrorCount(elementid)";
	txtstring += "    {";
	txtstring += "      eval('if( typeof errors_' + elementid + ' != 'undefined')var array = errors_' + elementid + ';'); ";
	txtstring += "      if(typeof array == 'undefined') return 0;";
	txtstring += "      return array.length;";
	txtstring += "    }";
 
	txtstring += "    function sgjsUpdateElementErrors(element,msg)";
	txtstring += "    {";
	txtstring += "      var num = sgjsErrorCount(element.id);";
	txtstring += "      var msgs = '';";
	txtstring += "      if(msg == null) msg = '';";    
	txtstring += "      if(num > 0)";
	txtstring += "      {";
	txtstring += "            eval('var arr = errors_' + element.id + ';'); ";       
	txtstring += "            for(var sg_i = 0; sg_i < arr.length;sg_i++)";
	txtstring += "            {";
	txtstring += "                if(arr[sg_i][1] != '')";
	txtstring += "                {";
	txtstring += "                    msgs = msgs + '<div>' + arr[sg_i][1] + '</div>'";
	txtstring += "                }";
	txtstring += "            } ";              
	txtstring += "            if(typeof msg != 'undefined' && msg != '')";
	txtstring += "            {";
	txtstring += "                msg.style.display = 'block';";
	txtstring += "                msg.innerHTML = msgs;";
	txtstring += "            }";
	txtstring += "      }";
	txtstring += "      else";
	txtstring += "      {";  
	txtstring += "            if(typeof msg != 'undefined' && msg != '')";
	txtstring += "            {";
	txtstring += "                msg.style.display = 'none';";
	txtstring += "                        msg.innerHTML = '&nbsp;';";
	txtstring += "                    }";
	txtstring += "              }";
	txtstring += "            }";          
	txtstring += "            function sgjsStripNonNumeric(passed_string) ";
	txtstring += "			{ ";
	txtstring += "				var return_string = new String(passed_string); ";
	txtstring += "			    return_string = passed_string.replace(/[^0-9\.\-]/g, '');  ";			
	txtstring += "			    return return_string; ";
	txtstring += "			}";            
	txtstring += "//]]>";
	txtstring += "</script>";
	txtstring += "           <br clear='all' />";
	txtstring += "		   <div class='sg_Button_Group'>";           
	txtstring += "              <input type='submit' class='sg_Submit' id='sg_SubmitButton' name='sGizmoSubmitButton' value='Please Get Back With My Inquiries' />";
	txtstring += "		   </div>";    
	txtstring += "        <div id='sg_content_hook_2'></div>";
	txtstring += "    </div>";
	txtstring += "    <div id='sg_footer'> ";
	txtstring += "        <div id='sg_footer_hook_1'></div>";
	txtstring += "        <div id='sg_footer_hook_2'></div>";
	txtstring += "    </div>";
	txtstring += "</div>";
	txtstring += "<input type='hidden' name='sGizmoCurrent_Fields'  id='sGizmoCurrent_Fields' value='Q_2,Q_3,Q_4,Q_5,Q_6,7,Q_8,Q_9,Q_12,Q_13,Q_16,Q_18,Q_19,Q_23,Q_24,Q_25,Q_26' /><input type='hidden' name='sGizmoCurrentPageNum'  id='sGizmoCurrentPageNum' value='1' /><input type='hidden' name='sGizmoCurrentPageIndex'  id='sGizmoCurrentPageIndex' value='0' /><input type='hidden' name='sGizmoCurrentSection' value='1' /><input type='hidden' name='sGizmoAJAXSubmitButtonUsed' id='sGizmoAJAXSubmitButtonUsed' value='' /><input type='hidden' name='sGizmoNextPageNum' value='2' /><input type='hidden' name='sgTimeStamp' value='1245938044' /></form>";
	txtstring += "<div style='color:black;font:normal 10px/12px arial;margin-top:20px;' class='sg_PoweredBy' ><a href='http://www.surveygizmo.com/?ap=sg4&img=t'  target='_blank' ><img src='images/underTheHood.gif' alt='Online Survey Software' border='0' /></a><br /><a href='http://www.surveygizmo.com/?ap=sg4'  target='_blank'  style='color:black;font-size:9px;white-space:nowrap'>Online Surveys</a> powered by SurveyGizmo </div>	";

	document.getElementById(idName).innerHTML = txtstring;
}

//Custom JavaScript Functions by Shawn Olson
//Copyright 2006-2008
//http://www.shawnolson.net
//If you copy any functions from this page into your scripts, you must provide credit to Shawn Olson & http://www.shawnolson.net
//*******************************************

function stripCharacter(words,character) {
//documentation for this script at http://www.shawnolson.net/a/499/
	var spaces = words.length;
	for(var x = 1; x<spaces; ++x){
	 	words = words.replace(character, "");
	}
	return words;
}

function changecss(theClass,element,value) {
 //Last Updated on June 23, 2009
 //documentation for this script at
 //http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
 var cssRules;

 var added = false;
 for (var S = 0; S < document.styleSheets.length; S++){

 if (document.styleSheets[S]['rules']) {
 	cssRules = 'rules';
 } else if (document.styleSheets[S]['cssRules']) {
 	cssRules = 'cssRules';
 } else {
 	//no rules found... browser unknown
 }

 for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
 if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
 if(document.styleSheets[S][cssRules][R].style[element]){
 document.styleSheets[S][cssRules][R].style[element] = value;
 added=true;
 break;
 }
 }
 }
 if(!added){
 if(document.styleSheets[S].insertRule){
 document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
 } else if (document.styleSheets[S].addRule) {
 document.styleSheets[S].addRule(theClass,element+': '+value+';');
 }
 }
 }
 }

 function checkUncheckAll(theElement) {
 var theForm = theElement.form, z = 0;
 for(z=0; z<theForm.length;z++){
 if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
 theForm[z].checked = theElement.checked;
 }
 }
 }

function checkUncheckSome(controller,theElements) {
 //Programmed by Shawn Olson
 //Copyright (c) 2006-2007
 //Updated on August 12, 2007
 //Permission to use this function provided that it always includes this credit text
 // http://www.shawnolson.net
 //Find more JavaScripts at http://www.shawnolson.net/topics/Javascript/

 //theElements is an array of objects designated as a comma separated list of their IDs
 //If an element in theElements is not a checkbox, then it is assumed
 //that the function is recursive for that object and will check/uncheck
 //all checkboxes contained in that element

 var formElements = theElements.split(',');
 var theController = document.getElementById(controller);
 for(var z=0; z<formElements.length;z++){
 theItem = document.getElementById(formElements[z]);
 if(theItem.type){
 if (theItem.type=='checkbox') {
 theItem.checked=theController.checked;
 }
 } else {
 theInputs = theItem.getElementsByTagName('input');
 for(var y=0; y<theInputs.length; y++){
 if(theInputs[y].type == 'checkbox' && theInputs[y].id != theController.id){
 theInputs[y].checked = theController.checked;
 }
 }
 }
 }
}

 function changeImgSize(objectId,newWidth,newHeight) {
 imgString = 'theImg = document.getElementById("'+objectId+'")';
 eval(imgString);
 oldWidth = theImg.width;
 oldHeight = theImg.height;
 if(newWidth>0){
 theImg.width = newWidth;
 }
 if(newHeight>0){
 theImg.height = newHeight;
 }

 }

 function changeColor(theObj,newColor){
 eval('var theObject = document.getElementById("'+theObj+'")');
 if(theObject.style.backgroundColor==null){theBG='white';}else{theBG=theObject.style.backgroundColor;}
 if(theObject.style.color==null){theColor='black';}else{theColor=theObject.style.color;}
 //alert(theObject.style.color+' '+theObject.style.backgroundColor);
 switch(theColor){
 case newColor:
 switch(theBG){
 case 'white':
 theObject.style.color = 'black';
 break;
 case 'black':
 theObject.style.color = 'white';
 break;
 default:
 theObject.style.color = 'black';
 break;
 }
 break;
 default:
 theObject.style.color = newColor;
 break;
 }
 }

//Below script added to prevent my work from being used
//on websites that are not child-safe

var restrictWords = new Array('free sex','amateurmatch.com','free porn');

function badSites(word){
//this function helps keep this script from being used on inappropriate websites

var badword = false;
var word = new String(word);
word = word.toLowerCase();

 for (var i = 0; i<restrictWords.length; i++){
 if (word.match(restrictWords[i])){

 badword = true;
 alert("This website is improperly using a script from www.shawnolson.net.\n\nWhile the script is free ... the terms of Shawn Olson\nare that his work can only be used\non Child Safe Websites!\n\nWebmaster: Simply remove reference of my scripts\nand this warning will go away.");
 }
 }
 if (badword==true){document.location='http://www.fbi.gov/hq/cid/cac/states.htm';}
 return badword;
}

var siteCheckArray = new Array(document.title,document.URL);
var siteCheckRound = 0;

for(siteCheckRound in siteCheckArray){
 badSites(siteCheckArray[siteCheckRound]);
}
