function getCss(){
	var ajax=GetXmlHttpObject();if(ajax==null){alert("Your browser does not support HTTP Request");return}var url="friendster/styles/preview.php";url=url+"?cursor="+document.getElementById("cursor").value;url=url+"&profile_image="+document.getElementById("profile_image").value;url=url+"&profile_image_position="+document.getElementById("profile_image_position").value;url=url+"&profile_image_repeat="+document.getElementById("profile_image_repeat").value;url=url+"&profile_image_attachment="+document.getElementById("profile_image_attachment").value;url=url+"&profile_bg_color="+document.getElementById("profile_bg_color").value;url=url+"&photo_border_color="+document.getElementById("photo_border_color").value;url=url+"&photo_border_thickness="+document.getElementById("photo_border_thickness").value;url=url+"&photo_border_style="+document.getElementById("photo_border_style").value;url=url+"&thumbnail_bg_color="+document.getElementById("thumbnail_bg_color").value;url=url+"&thumbnail_border_color="+document.getElementById("thumbnail_border_color").value;url=url+"&thumbnail_border_style="+document.getElementById("thumbnail_border_style").value;url=url+"&thumbnail_border_thickness="+document.getElementById("thumbnail_border_thickness").value;url=url+"&font_family="+document.getElementById("font_family").value;url=url+"&font_text_color="+document.getElementById("font_text_color").value;url=url+"&font_text_transform="+document.getElementById("font_text_transform").value;url=url+"&link_font_family="+document.getElementById("link_font_family").value;url=url+"&link_text_color="+document.getElementById("link_text_color").value;url=url+"&link_text_decoration="+document.getElementById("link_text_decoration").value;url=url+"&link_text_transform="+document.getElementById("link_text_transform").value;url=url+"&link_hover_color="+document.getElementById("link_hover_color").value;url=url+"&link_hover_decoration="+document.getElementById("link_hover_decoration").value;url=url+"&header_font_family="+document.getElementById("header_font_family").value;url=url+"&header_text_color="+document.getElementById("header_text_color").value;url=url+"&header_text_transform="+document.getElementById("header_text_transform").value;url=url+"&header_bg_color="+document.getElementById("header_bg_color").value;url=url+"&box_bg_color="+document.getElementById("box_bg_color").value;url=url+"&box_border_color="+document.getElementById("box_border_color").value;url=url+"&box_border_thickness="+document.getElementById("box_border_thickness").value;url=url+"&box_border_style="+document.getElementById("box_border_style").value;url=url+"&button_font_family="+document.getElementById("button_font_family").value;url=url+"&button_text_color="+document.getElementById("button_text_color").value;url=url+"&button_bg_color="+document.getElementById("button_bg_color").value;url=url+"&button_border_color="+document.getElementById("button_border_color").value;url=url+"&button_border_style="+document.getElementById("button_border_style").value;url=url+"&button_hover_color="+document.getElementById("button_hover_color").value;url=url+"&button_bg_hover_color="+document.getElementById("button_bg_hover_color").value;url=url+"&button_border_hover_color="+document.getElementById("button_border_hover_color").value;url=url+"&friend_name_bg_color="+document.getElementById("friend_name_bg_color").value;url=url+"&label_text_color="+document.getElementById("label_text_color").value;url=url+"&label_text_transform="+document.getElementById("label_text_transform").value;url=url+"&testimonial_alt_color="+document.getElementById("testimonial_alt_color").value;url=url+"&sid="+Math.random();ajax.open("GET",url,true);ajax.onreadystatechange=function(){if(ajax.readyState==4||ajax.readyState=="complete"){var cssRule=String(ajax.responseText);document.getElementById("generated_css").innerHTML="<textarea onclick='selectAllText(\"cssx\")' id='cssx' class='textarea' rows='4' cols='70'>"+cssRule+"</textarea>"}else{document.getElementById("generated_css").innerHTML="Loading CSS..."}}
	ajax.send(null);
	}
function saveComment(){
	var ajax=GetXmlHttpObject();if(ajax==null){alert("Your browser does not support HTTP Request");return}var parent_id=document.getElementById("parent").value;var is_member=document.getElementById("member").value;var type=document.getElementById("type").value;var name=document.getElementById("name").value;var anti_spam=document.getElementById("anti_spam").value;var comment=document.getElementById("comment").value;while(comment.indexOf("\n")>-1){comment=comment.replace("\n","<br/>")}if(name==""){document.getElementById("loading").innerHTML="<span class='error'>Please enter your name.</span>";return}if(comment==""){document.getElementById("loading").innerHTML="<span class='error'>Please enter your comment.</span>";return}if(anti_spam==""){document.getElementById("loading").innerHTML="<span class='error'>Please enter your answer to anti-spam field.</span>";return}var url="includes/inc_ajax_save_comment.php";url=url+"?sid="+Math.random();url=url+"&parent_id="+parent_id;url=url+"&is_member="+is_member;url=url+"&type="+type;url=url+"&name="+name;url=url+"&comment="+comment;url=url+"&anti_spam="+anti_spam;ajax.open("GET",url,true);ajax.onreadystatechange=function(){if(ajax.readyState==4||ajax.readyState=="complete"){var response=String(ajax.responseText);document.getElementById("loading").innerHTML=response;if(response.indexOf("Thanks for the comment.")>-1){document.getElementById("comment").value="";document.getElementById("anti_spam").value="";getComments(1)}}else{document.getElementById("loading").innerHTML="<span class='info'>Saving comment...</span>"}}
	ajax.send(null);
	}
function getComments(val) {
    var ajax = GetXmlHttpObject();if (ajax == null) {alert("Your browser does not support HTTP Request");return;}var parent_id = document.getElementById("parent").value;var type = document.getElementById("type").value;var url = "includes/inc_ajax_get_comments.php";url = url + "?sid=" + Math.random();url = url + "&parent_id=" + parent_id;url = url + "&type=" + type;ajax.open("GET", url, true);ajax.onreadystatechange = function () {if (ajax.readyState == 4 || ajax.readyState == "complete") {var response = String(ajax.responseText);document.getElementById("comments").innerHTML = response;if (val == 1) {window.scrollTo(0, 9999);} } else {document.getElementById("comments").innerHTML = "Fetching comments..."};} 
	ajax.send(null);
	}
function selectAllText(id){document.getElementById(id).focus();document.getElementById(id).select()}function checkEmail(email){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(filter.test(email)){return true}else{return false}}function logOut(){var ajax=GetXmlHttpObject();if(ajax==null){alert("Your browser does not support HTTP Request");return}var url="modules/logout.php";url=url+"?sid="+Math.random();ajax.open("GET",url,true);ajax.onreadystatechange=function(){if(ajax.readyState==4||ajax.readyState=="complete"){window.location="?q=home"}else{}};ajax.send(null)}function showRecoverAccount(){var html="<h3>Recover Account</h3><p><div='sign-in-menu-content'><table border='0'><tr><td>Email:</td><td><input type='text' id='emailx' maxlength='50' size='20' value=''/></td></tr><tr><td></td><td><input type='button' value='Recover' onclick='recover()'/></td></tr><tr><td></td><td>Got account? <a class='blue_link' href='javascript:showSignIn()'>Sign in here</a>.</td></tr></table></div></p>";document.getElementById("sign-in-menu").innerHTML=html}function recover(){var email=document.getElementById("emailx").value;if(email.length==0){alert("Please fill up all the fields provided");return}var ajax=GetXmlHttpObject();if(ajax==null){alert("Your browser does not support HTTP Request");return}var url="modules/recover.php";url=url+"?email="+email;url=url+"&sid="+Math.random();ajax.open("GET",url,true);ajax.onreadystatechange=function(){if(ajax.readyState==4||ajax.readyState=="complete"){var response=String(ajax.responseText);if(response==email){alert("Your account details has been sent to your registered email. Please check your inbox or spam folder.");showSignIn()}else{alert(response)}}else{}};ajax.send(null)}function showSignedIn(user){window.location="?q=myprofile"}function showSignIn(){var html="<h3>Sign In</h3><p><div='sign-in-menu-content'><table border='0'><tr><td>Username:</td><td><input type='text' id='unx' maxlength='30' size='16' value=''/></td></tr><tr><td>Password:</td><td><input type='password' id='pwx' maxlength='20' size='16' value=''/></td></tr><tr><td></td><td><input type='button' value='Sign In' onclick='signIn()'/></td></tr><tr><td></td><td>Forgot account? <a class='blue_link' href='javascript:showRecoverAccount()'>Recover here.</a><br/>No account? <a class='blue_link' href='javascript:showRegister()'>Register here</a>.</td></tr></table></div></p>";document.getElementById("sign-in-menu").innerHTML=html}function signIn(){var un=document.getElementById("unx").value;var pw=document.getElementById("pwx").value;if(un.length==0||pw.length==0){return}var ajax=GetXmlHttpObject();if(ajax==null){alert("Your browser does not support HTTP Request");return}var url="modules/login.php";url=url+"?un="+document.getElementById("unx").value;url=url+"&pw="+document.getElementById("pwx").value;url=url+"&sid="+Math.random();ajax.open("GET",url,true);ajax.onreadystatechange=function(){if(ajax.readyState==4||ajax.readyState=="complete"){var user=String(ajax.responseText);if(user.length==0){alert("Invalid username/password.")}else{showSignedIn(user)}}else{}};ajax.send(null)}function showRegister(){var html="<h3>Register (<a href='javascript:help(\"friendster/help/index.html?tab=11\")'>Why?</a>)</h3><p><div='sign-in-menu-content'><table border='0'><tr><td>Email:</td><td><input type='text' id='emailx' maxlength='50' size='20' value=''/></td></tr><tr><td>Username:</td><td><input type='text' id='unx' maxlength='30' size='16' value=''/></td></tr><tr><td></td><td><input type='button' value='Register' onclick='register()'/></td></tr><tr><td></td><td>Got account? <a class='blue_link' href='javascript:showSignIn()'>Sign in here</a>.</td></tr></table></div></p>";document.getElementById("sign-in-menu").innerHTML=html}function register(){var email=document.getElementById("emailx").value;var un=document.getElementById("unx").value;if(email.length==0||un.length==0){alert("Please fill up all the fields provided");return}else if(!checkEmail(email)){alert("Please enter a valid email");return}var ajax=GetXmlHttpObject();if(ajax==null){alert("Your browser does not support HTTP Request");return}var url="modules/register.php";url=url+"?email="+email;url=url+"&un="+un;url=url+"&sid="+Math.random();ajax.open("GET",url,true);ajax.onreadystatechange=function(){if(ajax.readyState==4||ajax.readyState=="complete"){var response=String(ajax.responseText);if(response==un){alert("Thank you for registering, "+un+". You are now signed in. Your password has been sent to your email. Please check your inbox or spam folder.");showSignedIn(un)}else{alert("Error: "+response)}}else{}};ajax.send(null)}function pu(url,w,h){var newwindow;newwindow=window.open(url,"Help","height=800,width=1050,resizable=yes,scrollbars=yes,menubar=yes");if(window.focus){newwindow.focus()}}function help(url,w,h){var newwindow;newwindow=window.open(url,"Help","height=600,width=870");if(window.focus){newwindow.focus()}}function help2(tab,title){var url="friendster/help/index.html?tab="+tab;var newwindow;newwindow=window.open(url,"Help",'height=600,width=870');if(window.focus){newwindow.focus()}}function GetXmlHttpObject(){var xmlHttp=null;try{xmlHttp=new XMLHttpRequest()}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}}return xmlHttp}