
function setPrintOutText(){


	document.getElementById("printOut222").innerHTML=FCKeditorAPI.GetInstance('logoText').GetHTML()  ;

}


function setBG(){
	//setTimeout("document.getElementById('printOut222').style.background=getValue('clr');",200);
}

function getValue(id){
	var val=document.getElementById(id).value;
	return val;
}


function updating(){

}

function loadurl(dest,data,cf,td) {
	 try {
    	 xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");


	 } catch (e) {



	 }

	 xmlhttp.onreadystatechange = triggered;
	 xmlhttp.open("POST", dest);
	 xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
// 	 xmlhttp.setRequestHeader("Content-type", "text/html; charset=ISO-8859-2");
	 xmlhttp.send(data);
		callFunc=cf;
		targetDiv=td;
	 // send the request. if this is a POST request we would have
	 // sent post variables: send("name=aleem&gender=male)
	 // Moz is fine with just send(); but
	 // IE expects a value here, hence we do send(null);



 }



function triggered() {
	 if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
	    //alert(xmlhttp.responseText+"--"+jo);
		if (callFunc==''){

		}
		if (callFunc=='debug'){
			alert(xmlhttp.responseText);
		}
		if (callFunc=='afterSave'){
			afterSave(xmlhttp.responseText);
		}




	 }

 }




 function saveDesign(){
 		var firstname=getVal("design_firstName");
 		var lastname=getVal("design_lastName");
 		var dEmail=getVal("design_email");
 		var design=getVal("logoText");
 		var action=getVal("design_action");
 		var d_id=getVal("design_id");
 		var design_background=getVal("design_background");


 		data="firstname="+firstname;
 		data=data+"&lastname="+lastname;
 		data=data+"&email="+dEmail;
 		data=data+"&design="+FCKeditorAPI.GetInstance('logoText').GetHTML()  ;
 		data=data+"&action="+action;
 		data=data+"&id="+d_id;
 		data=data+"&design_background="+design_background;

 		loadurl("insert_design.php",data,"afterSave","")



 }

	/**
	 *
	 * @access public
	 * @return void
	 **/
	function afterSave(text){
		//alert(text);
		document.getElementById("design_action").value="edit";
		if (text) {
			document.getElementById("design_id").value=text;

		}


	}

 function getVal(id){

 	var val=document.getElementById(id).value;
 	return(val);
 }



 function showBackgrounds(){
 	new Effect.BlindDown('selectBgimageDiv',{ duration: 1 });
 }

  function hideBackgrounds(){
 	new Effect.BlindUp('selectBgimageDiv',{ duration: 1 });
 }


 /**
  *
  * @access public
  * @return void
  **/
 function setBg(el){
 	//alert(el);
 	$("printOut222").style.background="url("+el+")";
 	$("design_background").value=el;
 }
