function get_iframe_content(obj) {
	window.frames[obj].document.body.innerHTML = document.getElementById(obj).value;	
	
}

function get_portfolio(val) {
	var url = "portfolio_op.php?val="+val;
	ajax_req("GET",url+'?bustcache='+new Date().getTime(),"portfolio_done");
	
}
function portfolio_done() {
  if (ajax.readyState == 4) {
  	
		var pic = document.getElementById('pic');
		var name = document.getElementById('name');
		var descr = document.getElementById('description');
		var thumbs = document.getElementById('thumbs');
		
		var pics = ajax.responseText.split("\r\n");
		
		//alert(ajax.responseText);
		pic.innerHTML = "<img alt='' src='uplds/m-"+pics[0]+"'>";
		name.innerHTML = pics[1];
		document.getElementById('descr').innerHTML = pics[2];
		
		if (pics[3]!= 'same'){	
			iner=((pics[3]==0)?"<div style='width:120px;text-align:center;float:left'><img src='images/spacer.gif'></div>":"<div style='width:120px;text-align:center;float:left'><a href='javascript:get_portfolio(\"0/"+pics[3]+"\")' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage(\"left\",\"\",\"images/move-left-over.gif\",1)'><img name='left' id='left'  src='images/move-left.gif'></a></div>");
			for (var i=4;i<pics.length-1;i=i+3){
				iner = iner + "<div style='width:120px;text-align:center;float:left'><a href='javascript:get_portfolio(\""+pics[i]+"/-"+pics[i+1]+"\")'><img alt='' src='uplds/t-"+pics[i+2]+"' ></a></div>";
			}
			iner = iner + ((pics[pics.length-1]==0)?"<div style='width:120;text-align:center;float:left'><img src='images/spacer.gif'></div><br clear='all'>":"<div style='width:120px;text-align:center;float:left'><a href='javascript:get_portfolio(\"0/"+pics[pics.length-1]+"\")' onmouseout='MM_swapImgRestore()' onmouseover='MM_swapImage(\"right\",\"\",\"images/move-right-over.gif\",1)'><img name='right' id='right' src='images/move-right.gif'></a></div><br clear='all'>");
			thumbs.innerHTML = iner;
		}
		//document.styleSheets[1].href = 'css/style.css';
	}
}


function f_trimmer(thisstring)
{
	while(thisstring.charAt(0)==" ")
	{
		thisstring=thisstring.substring(1,thisstring.length);
	}
	return thisstring;
}

function checkme(){
	
if (document.myform.username){
	if (f_trimmer(document.myform.username.value)==""){
		alert("Username is required");
		document.myform.username.focus();
		
		return false;
	} 
}

if (document.myform.password){
	if (f_trimmer(document.myform.password.value)==""){
		alert("Password is required");
		document.myform.password.focus();
		
		return false;
	} else {
		if (f_trimmer(document.myform.password.value)!=f_trimmer(document.myform.password2.value)){
			alert("Password not confirmed");
			document.myform.password2.focus();
			return false;
		}
			
	}
}

if (document.myform.name){
	if (f_trimmer(document.myform.name.value)==""){
		 alert("Name is required");
		 document.myform.name.focus();
		 return false;
	}
}

if (document.myform.mail){
	
	if (f_trimmer(document.myform.mail.value)==""){
		alert("Email is required\n");
		document.myform.mail.focus();
		return false;
	} else {
   		var s = new String(document.myform.mail.value);

       	if ((s.indexOf(".")==-1 || s.indexOf("@")==-1)){       
       		alert ("Your Email address is invalid.");
			document.myform.mail.focus();
			return false;
		}
	}
}

if (document.myform.company){
	if (f_trimmer(document.myform.company.value)==""){
		 alert("Company name is required");
		 document.myform.company.focus();
		 return false;
	}
}

if (document.myform.scode){
	if (f_trimmer(document.myform.scode.value)==""){
		alert("Security code not confirmed");
		document.myform.scode.focus();
		
		return false;
	} 
}


}
