var locate = window.location;
document.tempForm.getVariable.value = locate;


function delineate(str){

	point = str.lastIndexOf("?");
	return(str.substring(point+1,str.length));
}
var clientVar = delineate(document.tempForm.getVariable.value);

//var regExp = new RegExp("%2F","g");
//var thestring = clientVar;
//var result = thestring.replace(regExp,"/");



function getSelectOptionOfThisValue(thisSelect, thisValue) {
    var found = 0;
    var optionNo = 0;
    for (i = 0; thisSelect[i]; i++) {
		point = thisSelect[i].value.indexOf('#');
		href = thisSelect[i].value.substring(0, point);
        if (href == thisValue) {
            optionNo = i;
            found = 1;
             //alert("Naslo sa " +  thisValue + " in " + thisSelect + ".");
            //return i;
        }
    }
    
    selectClientOption(optionNo);
   
}

function selectClientOption(clientOrder) {
	//alert("klient ma cislo " +clientOrder);
	if(clientVar.substring(0, 7) != "http://")
		document.form1.portfolioSelect.options[clientOrder].selected = true;
}

function executeScript() {
	var formular = document.form1.portfolioSelect;
	getSelectOptionOfThisValue(formular, clientVar);
	if(clientVar.substring(0, 7) != "http://"){
		portfolioIframe.window.location.href = clientVar;
		var timeoutFlash = setTimeout("changePort()", 800);
	}

}

