// JavaScript Document
var staticpage=500;
	var contactpage=1000;
	var feedback=1000;
	var logos=1000;
	
	lCheck=0;
	cCheck=0;
	fCheck=0;
	
function changeform(){
	
var dors=document.getElementById('dors');
	//alert(dors.value);
	var colid=document.getElementById('secportion');
	
	var priceColid=document.getElementById('priceCol');
if(dors.value=='static'){
	colid.innerHTML="<table width=100% border=0 cellspacing=1 cellpadding=1><tr><td class=bottomLine width=41% scope=row><p>Number of pages you willing to  have in your website:</p></td><td class=bottomLine width=59%><input type=text name=pages id=pages  onkeyup=countValue()></td></tr><tr><td  class=bottomLine scope=row>Want your logo to be designed by us?</td><td class=bottomLine><select name=logo id=logo onchange=countValueLogo();><option value=yes>Yes</option><option value=no>No</option></select></td></tr><tr><td  class=bottomLine scope=row>Need contact us form?</td><td class=bottomLine><select name=contact id=contact onchange=countValueContact();><option value=yes>Yes</option><option value=no>No</option></select></td></tr><tr><td  class=bottomLine scope=row>Need feedback form?</td><td class=bottomLine><select name=feedback id=feedback onchange=countValueFeed();><option value=yes>Yes</option><option value=no>No</option></select></td></tr></table>";
	priceColid.innerHTML="<input name=price type=text id=price value=0 size=10 />";
		}else{ 
		colid.innerHTML="<table width=100% border=0 cellspacing=1 cellpadding=1><tr><td width=35% valign=top scope=row><b>Detail:</b><br>( Please write what do you want in your website.) </td><td width=65%><textarea name=detail cols=40 rows=15></textarea></td></tr></table>";	
		priceColid.innerHTML="Negociatable";
		}
}

function countValue(){
	var pages=document.getElementById('pages');
	var logo=document.getElementById('logo');
	var contact=document.getElementById('contact');
	var fback=document.getElementById('feedback');
	var total=document.getElementById('price');
	//alert('hello');
	if(pages.value>=1){
		total.value=parseInt(pages.value)*staticpage;
		
		//alert(logo.value);
		if(logo.value=='yes')
			total.value=parseInt(total.value)+logos;
		
			
			if(contact.value=='yes')
			total.value=parseInt(total.value)+contactpage;
		
			
		if(fback.value=='yes')
			total.value=parseInt(total.value)+feedback;
		
			
			


		
	}
	
	
}

function countValueLogo(){
	var pages=document.getElementById('pages');
	var logo=document.getElementById('logo');
	var contact=document.getElementById('contact');
	var fback=document.getElementById('feedback');
	var total=document.getElementById('price');
	
	if(logo.value=='yes' && lCheck==0){
		if(pages.value>=1){
			total.value=parseInt(total.value)+logos;
			lCheck=1;
			
		}
	}else{
		
		if(pages.value>=1){
			total.value=parseInt(total.value)-logos;
			lCheck=0;
			
		}
		
		
	}
}

function countValueContact(){
	var pages=document.getElementById('pages');
	var logo=document.getElementById('logo');
	var contact=document.getElementById('contact');
	var fback=document.getElementById('feedback');
	var total=document.getElementById('price');
	
	if(contact.value=='yes' && cCheck==0){
		if(pages.value>=1){
			total.value=parseInt(total.value)+contactpage;
			cCheck=1;
			
		}
	}else{
		
		if(pages.value>=1){
			total.value=parseInt(total.value)-contactpage;
			cCheck=0;
			
		}
		
		
	}
}

function countValueFeed(){
	var pages=document.getElementById('pages');
	var logo=document.getElementById('logo');
	var contact=document.getElementById('contact');
	var fback=document.getElementById('feedback');
	var total=document.getElementById('price');
	
	if(fback.value=='yes' && fCheck==0){
		if(pages.value>=1){
			total.value=parseInt(total.value)+feedback;
			fCheck=1;
			
		}
	}else{
		
		if(pages.value>=1){
			total.value=parseInt(total.value)-feedback;
			fCheck=0;
			
		}
		
		
	}
}