// =======================================================================================================================================
// vigo great form validator v2.0
//

var js_LID;

rotation_path							=	"/img/rotation/";
var rotasyonResimler					=	new Array();
var totalImages							=	4;
var rotCounter							=	0;

for(i=0;i<(totalImages);i++){
	rotasyonResimler[i]					=	new Image();
	rotasyonResimler[i].src				=	rotation_path+"rotPic"+i+".jpg"
}



function start_rotator(){
	if(rotCounter>totalImages-1){rotCounter=0;}	
	picObj								=	document.getElementById("rotasya");
	picObj.src							=	rotasyonResimler[rotCounter].src;
	rotCounter++;
	setTimeout("start_rotator();",5*1000);

}

//-----------------------------------------------------------------------------------------------------------------------------
function checkForms(formName){
	erMes = "Error - Empty Field !...";
	if(JsLang="tr"){erMes = "Hata !!! Formun bu alanı boş kalamaz ...";}
	var FormObj = eval("document."+formName);
		for(i=0;i<FormObj.elements.length;i++){
				if(FormObj.elements[i].value.length==0 && FormObj.elements[i]!= FormObj.elements.author_id ){alert(erMes);FormObj.elements[i].focus();return false;};
		}
}
//-----------------------------------------------------------------------------------------------------------------------------
function Refresher(){
	window.navigate(arguments[0]);
}
//-----------------------------------------------------------------------------------------------------------------------------

function valid_email()
{
	if( "string" != typeof arguments[0] ){ return false; }
	regPattern = /^([\w\-\_\.]+(@)[\w\-\_]+(\.)[\w\.]+)$/i;
	re = new RegExp(regPattern);
	return re.test(arguments[0]);
}
function valid_url(){
	input_data=arguments[0];
	pattern_data = "((.*)[\.](.*)[\.](.*))|(http:\/\/(.*)[\.](.*)[\.])";
	var regEX = new RegExp(pattern_data);
	return regEX.test(input_data);
}
function valid_img(inputString){
	rpattern = /http\:\/\/(.*)\/(.+)\.(gif|jpg|png)/i;
	var regEX = new RegExp(rpattern);
	return regEX.test(inputString);

}
// =======================================================================================================================================
function vbGO(){window.location.href=arguments[0];}
// =======================================================================================================================================

// =======================================================================================================================================

	var ico_plus		=	new Image();
	ico_plus.src		=	"/img/ico_plus.gif";

	var ico_minus		=	new Image();
	ico_minus.src		=	"/img/ico_minus.gif";


function vSwitcher(){
	attribName			=	arguments[0].toLowerCase();
	tableAmount			=	parseFloat(arguments[1]);
	deepLevel			=	parseFloat(arguments[2]);

	iValue				=	parseFloat(arguments[3]);
	
	iconImg				=	document.getElementById("ico"+iValue);
	if(iconImg.src.indexOf("plus")>-1){iconImg.src=ico_minus.src;}
	else{iconImg.src=ico_plus.src;}

	for(i=0;i<tableAmount;i++){
		tableObj		=	document.getElementById("tbl"+i);
		tableObj_SWNAME	=	tableObj.attributes.getNamedItem("SWNAME");
		tableObj_DEEP	=	tableObj.attributes.getNamedItem("DEEP");
		if(tableObj_SWNAME){
			if(tableObj_SWNAME.value.indexOf(attribName)>-1){
				if(tableObj_DEEP.value>deepLevel){
					tableObj_display	=	tableObj.style.display;
					if((tableObj_display=="none")&&(tableObj_DEEP.value-deepLevel==1)){
						tableObj.style.display="block";
						}
					else{
						tableObj.style.display="none";
						try {document.getElementById("ico"+i).src=ico_plus.src;}
						catch(e){
						}
						
						}


				}

			}
		}
	}

}
// =======================================================================================================================================
function vbOWiN(sURL,pW,pH,iSCROLL_BAR,isWinName){
	if(sURL.length>0){
		pX = Math.round((window.screen.width-pW)/2);
		pY = Math.round((window.screen.height-pH)/2);
		sFea = "height="+pH+",width="+pW;
		sFea+= "status=no,toolbar=no,menubar=no,location=no,resizable=no,left="+pX+",top="+pY;
	if(iSCROLL_BAR=="yes"){sFea+=",scrollbars=yes";}
	if(isWinName){oNewWindow = window.open(sURL,isWinName,sFea);}
	else{oNewWindow = window.open(sURL,null,sFea);}
	oNewWindow.focus();
	}
}
// =======================================================================================================================================