/*************************************************

	              function.js

	

*************************************************/

function setCheckBox(theForm,theStatus) {

	var sus=eval("window.document."+theForm+".elements.length");

	for(j=0;j<sus;j++) {

		if(eval("window.document."+theForm+".elements["+j+"].type")=="checkbox") {

			eval("window.document."+theForm+".elements["+j+"].checked="+theStatus);

		}

	}

}

function delete_resume(url)

{ var str="Are You sure want to delete this resume";

  ch=confirm(str);

  if(ch)

  { window.location.href=url;}

  else

  { return false;}

}

function delete_something(theURL,theValue,theMsg) {

	var str="Are you sure to delete this "+theMsg+" : "+theValue+" ?    ";

	choice=confirm(str);

	if(choice) {

		window.location.href=theURL;

	} else {

		return false;

	}

}

function setFocus(theForm,theElement) {

	eval("window.document."+theForm+"."+theElement+".focus()");

}

function popupOpen(theURL,windowName) {

	window.open(theURL,windowName,'height=250,width=450,toolbar=0,status=1,scrollbars=1,menubar=0,left=287,top=259');

}

function setCombo(theForm,theElement,theMess) {

	var str=eval("window.document."+theForm+"."+theElement+".selectedIndex");

	if(str==0) {

		alert("Please select a value for "+theMess+"    ");

		eval("window.document."+theForm+"."+theElement+".focus()");

		return false

	}

}

function NewWindow(theURL,windowName,theStatus) {

	theStatus+=",toolbar=0,status=1,scrollbars=1,menubar=0,resizable=0";

	window.open(theURL,windowName,theStatus);

}

function CheckFileField(theForm,theElement,theValue) {

	var fileVal=eval("window.document."+theForm+"."+theElement+".value");

	if(fileVal=="")	{

		alert("Please provide a "+theValue+" Image    ");

		eval("window.document."+theForm+"."+theElement+".focus()");

		return false;

	}

	var ext=fileVal.substr(fileVal.lastIndexOf(".")).toLowerCase();

	if(ext!=".gif" && ext!=".jpeg" && ext!=".png" && ext!=".jpg") {

		alert("This is not an image file ! Please verify    ");

		eval("window.document."+theForm+"."+theElement+".focus()");

		eval("window.document."+theForm+"."+theElement+".select()");

		return false;

	}

}

function ChangePassword(theForm,OldElement,NewElement,ConfElement) {

	var OldValue=eval("window.document."+theForm+"."+OldElement+".value");

	var NewValue=eval("window.document."+theForm+"."+NewElement+".value");

	var ConfValue=eval("window.document."+theForm+"."+ConfElement+".value");

	if(OldValue=="" || NewValue=="" || ConfValue=="") {

		alert("Any password field can not blank    ");

		return false;

	} else {

		if(NewValue!=ConfValue) {

			alert("New Password and Confirm Password should be same    ");

			eval("window.document."+theForm+"."+ConfElement+".focus()");

			eval("window.document."+theForm+"."+ConfElement+".select()");

			return false;

		}

	}

}

function SpellCheck(form_name,field_name) 

{

  

  

  var textform= self.document[form_name][field_name].value;

  

  

  //textform = "dfghfhfghfghfgh";

  

  //обратно записване в формата

  //self.document[form_name][field_name].value = "alabala i towa e";

  

  //съобщение

  //alert (textform);

  win_pop('');

  

  self.document.hidden_form.form_name.value = form_name; //w skritata forma se izpolzwa ime na pole form_name i field_name

  self.document.hidden_form.field_name.value = field_name;  

  //alert(self.document.hidden_form.field_name.value);

  self.document.hidden_form.first_time_text.value = textform;

  self.document.hidden_form.submit();

  

}

function win_pop(URL)

{ 

    winname=window.open(URL,'WIN','width=450,height=380,left=210,top=210,resizable=no,scrollbars=yes,status=yes'); 

return winname;

}