function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=350,height=300,scrollbars=yes');
return false;
}

function reloadproduct(form,uri)
{
	//get text
	var val=form.make.options[form.make.options.selectedIndex].value;
	//alert(val);
	self.location=uri+'/'+val;
}

function enableportfolio(elem)
{	
	var w=document.frmregister.type.selectedIndex;
	var param = document.frmregister.type.options[w].text;
	
	alert(param);
	if(param=='Portfolio')
		elem.disabled = false;
	else
		elem.disabled = true;
}

function disable(aList)
{
	var param=aList.options[aList.selectedIndex].text;
	var x=document.getElementById("portfolio")
	if(param=='Portfolio')
		x.disabled = false;
	else
		x.disabled = true;
}

function disable_claim(str){
	var v = str.value;
	var x=document.getElementById("claim_experience")
	if(v=='Yes')
		x.disabled = false;
	else
		x.disabled = true;
}

function init()
{
	var param=document.frmregister.type.options[document.frmregister.type.selectedIndex].text;
	var x=document.getElementById("portfolio")
	if(param=='Portfolio')
		x.disabled = false;
	else
		x.disabled = true;
}

function ajaxpost(siteurl,param,tag)
{
	var w=document.frmregister.make.selectedIndex;
	var param = document.frmregister.make.options[w].text;
	//alert(param);
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null){
		alert ("Browser does not support HTTP Request");
		return;
	}
	var strurl=siteurl;
	var param='postdata='+param;

	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
			document.getElementById(tag).innerHTML=xmlHttp.responseText;
		}
	} 
	xmlHttp.open("POST",strurl,true);
	
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	
	xmlHttp.send(param);
}

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try{
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
 	}
	catch (e){
	 // Internet Explorer
	 try{
	 	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	 }
	 catch (e){
	  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	 }
	}
	return xmlHttp;
}


