function reset_bio_date(str){
		document.getElementById(str).value=""
	}
	function setCodes(s,p) {
		frm=document.getElementById('buildlist');
		with(frm) {
			sectorsindustry.value = s;
			sector_type.value = p;
		}
	}
	function clear_bio_name(str){
		if(document.getElementById(str).value=="First Name")
			document.getElementById(str).value=""
		if(document.getElementById(str).value=="Middle Name")
			document.getElementById(str).value=""
		if(document.getElementById(str).value=="Last Name")
			document.getElementById(str).value=""
	}
	
	function submit_bio_form(){
		if(trim(addofficer.first_name.value)=="" || trim(addofficer.first_name.value)=="First Name"){
			alert("\nFirst Name is Required\n");
			return false;
		}		
		if(trim(addofficer.last_name.value)=="" || trim(addofficer.last_name.value)=="Last Name"){
			alert("\nLast Name is Required\n");
			return false;
		}
		if(addofficer.day.value == "" || addofficer.month.value == "" || addofficer.year.value == ""){
			alert("\nDate of Birth is Required\n");
			return false;
		}
		if(trim(addofficer.nationality.value) == ""){
			alert("\nNationality is Required\n");
			return false;
		}
		if(trim(addofficer.academic_bground.value) == ""){
			alert("\nAcademic Background is Required\n");
			return false;
		}
		if(trim(addofficer.biography.value) == ""){
			alert("\nBiography is Required\n");
			return false;
		}		
		var bool=false;
		for(i=1;i<10;i++){
			if(trim(document.getElementById("company_name"+i).value) != "" && trim(document.getElementById("position"+i).value) != "" && trim(document.getElementById("frmmonth"+i).value) != "" && trim(document.getElementById("frmyear"+i).value) != ""){
				bool=true;
			}
		}
		if(bool==false){
			alert("\nAt Least On Position is Required\n");
			return false;
		}
		if(trim(addofficer.middle_name.value) == "Middle Name")
			addofficer.middle_name.value="" 
		return true;
	}

function SH_Other(){
	cg=document.getElementById("OthersTab").className;
	if(cg == "notgone" || cg == ""){
		document.getElementById("OthersTab").className = "gone";	
	}
	else if(cg == "gone") {
		document.getElementById("OthersTab").className = "notgone";
	}	
}
	
var show=false;
var global_type="";
var submit_delay=false;
function show_hide(id,type,name,inActive, obj){
	if(validObject(document.getElementById("OthersTab")))
		SH_Other();
		
	if(submit_delay == false){
		if(show == false){
			show=true;global_type = type;		
			return showTalkTo(id,type,name,inActive, obj);
		}
		else if (show == true && global_type == type){
			document.getElementById("div_"+global_type).className = "gone";
			if (validObject(document.getElementById("div_"+global_type+"_con")))
				document.getElementById("div_"+global_type+"_con").className = "gone";
			show=false;global_type = type;
			return false;
		}
		else if (show == true && global_type != type && (type == 'undefined' || type == null)){
			document.getElementById("div_"+global_type).className = "gone";
			if (validObject(document.getElementById("div_"+global_type+"_con")))
				document.getElementById("div_"+global_type+"_con").className = "gone";
			show =false;
			return false;
		}
		else if (show == true && global_type != type){
			document.getElementById("div_"+global_type).className = "gone";
			if (validObject(document.getElementById("div_"+global_type+"_con")))
				document.getElementById("div_"+global_type+"_con").className = "gone";
			show=true;global_type = type;		
			return showTalkTo(id,type,name,obj);
		}
	}
}

var iframeCode = "";
function showTalkTo(id,type,name,inActive, obj){
	var tab_el = window.document.getElementById("div_"+type);	
	if((tab_el.innerHTML.indexOf("Thank you for your feedback.") !=-1) || tab_el.innerHTML.indexOf("شكرا على إقتراحك") !=-1)
		tab_el.innerHTML = '<div class="loadimg"><img src="/images/LoadingData.gif" border="0" style="vertical-align:middle"> <font class="greytextsmall">Loading ...</font></div>';
	if(typeof(obj) == 'object'){
		var objPos = findPos(obj);			
		tab_el.style.left = objPos[0] + 'px';
		tab_el.style.top = eval(objPos[1]+8) + 'px';
	}		
	if (tab_el.innerHTML.indexOf("Loading ...")!= -1 && tab_el.innerHTML.indexOf("LoadingData.gif")!= -1)
		ajaxCaller.getPlainText("/zscripts/xml.cfm?"+type+"&"+inActive+"&companyid="+id+"&name="+name,loadBackTalk,"div_"+type);
	document.getElementById("div_"+type).className = "notgone";
	if (validObject(document.getElementById("div_"+global_type+"_con")))
		document.getElementById("div_"+global_type+"_con").className = "notgone";
	return false;
}

function submitTalkTo(url,fObj,callBack,lang)
{
	var validate;	
	if(global_type == "mutualtalk")
		validate=validate_mutual_input(lang);
	else if(global_type == "mutualhometalk")
		validate=validate_mutual_input(lang);
	else if(global_type == "mutualsearchtalk")
		validate=validate_mutual_input(lang);
	else if(global_type == "buythisfund" || global_type == "cwfmanager")
		validate=validate_buythisfund(lang);
	else if(global_type == "biography")
		validate=submit_bio_form();
	else
		validate=validate_input();
	if(validate == false)
		return false;
		
	submit_delay = true;
	form_postForPlainText(url,fObj,callBack);	
	window.document.getElementById("div_"+global_type).innerHTML = '<div class="loadimg"><img src="/images/LoadingData.gif" border="0" style="vertical-align:middle"> <font class="greytextsmall">Sending ...</font></div>';
	return false;	
}

function returnSubmitTalkTo()
{
	window.document.getElementById("div_"+global_type).innerHTML = '<div align="center" class="MPHeaderOrange" style="padding:40px 0px;"><strong>Thank you for your feedback.</strong></div>';
	window.setTimeout(show_hide,1500);
	window.setTimeout(no_function,1500);
	submit_delay = false;
	return false;
}

function ArabicreturnSubmitTalkTo()
{
	window.document.getElementById("div_"+global_type).innerHTML = '<div align="center" class="arabic_text" style="padding:40px 0px; color:#e87f26;"><strong>شكرا على إقتراحك</strong></div>';
	window.setTimeout(show_hide,1500);
	window.setTimeout(no_function,1500);
	submit_delay = false;
	return false;
}

function no_function(){}

function loadBackTalk(text,callingContext,headers,arrParams){
	if (text.replace(/ /g,"") != "")
	{
		window.document.getElementById(callingContext).innerHTML = text;
		var tmp = window.document.URL;
		tmp = tmp.replace(/www/g,"cm1");
		tmp = tmp.replace(/dev/g,"cm1");		
		try{window.document.getElementById("current_url_talk").value = tmp;}catch(e){}
	}
}

function loadDataTalkTo(text,callingContext,headers,arrParams)
{
	if (text.replace(/ /g,"") != "")
	{
		window.document.getElementById(callingContext).innerHTML = text;
		var tmp = window.document.URL;
		tmp = tmp.replace(/www/g,"cm1");
		tmp = tmp.replace(/dev/g,"cm1");		
		window.document.getElementById("current_url_talk").value = tmp;
	}
}

function validate_buythisfund(lang){
	var name_error, email_error, phone_error;
	if (lang == "arabic")
	{
		name_error = "الرجاء إدخال الإسم";
		email_error = "البريد الإلكتروني غير صحيح";
		phone_error = "الرجاء إدخال رقم الهاتف";
	}
	else
	{
		name_error = "Enter your name";
		email_error = "Email address is incorrect";
		phone_error = "Enter your telephone number";
	}
	
	if (trim(window.document.talk_to_form.user_name.value) == '') {
    window.document.getElementById("talkError").innerHTML = name_error;
    document.getElementById("user_name").focus()
    return false
  }
	if (document.getElementById("email").value.indexOf('@',0)==-1 ||
    document.getElementById("email").value.indexOf('@',0)== 0 ||
   	document.getElementById("email").value.indexOf('/',0)>-1 ||
   	document.getElementById("email").value.indexOf(':',0)>-1 ||
   	document.getElementById("email").value.indexOf(',',0)>-1 ||
   	document.getElementById("email").value.indexOf(';',0)>-1 ||
   	document.getElementById("email").value.indexOf(' ',0)>-1 ||
    document.getElementById("email").value.indexOf('.',0)==-1){
   	window.document.getElementById("talkError").innerHTML = email_error;
   	document.getElementById("email").select()
   	document.getElementById("email").focus()
   	return false
  }
	if (trim(document.getElementById("phone").value) == '') {
    window.document.getElementById("talkError").innerHTML = phone_error;
    window.document.talk_to_form.phone.focus()
    return false
  }
	return true;
}

function validate_input() {
 	if (window.document.talk_to_form.affected_company_name.value == '') {
	    window.document.getElementById("talkError").innerHTML = "Please enter section name";
	    window.document.talk_to_form.affected_company_name.focus()
	    return false
    }
		
	var feedbackDefault1 = "When you make suggestions for improvements or changes well include this in our regular product testing and updates to provide the best possible solution for you.";
	var feedbackDefault2 = "When you ask us a question our customer support team will go out of their way to help clarify any queries you have.";
	var feedbackDefault3 = "When you send us an update well quickly amend any changes you request.";
	var feedbackDefault4 = "When you complain youll be contacted by our team to help resolve any concerns you may have.";
	var feedbackDefault5 = "When you sing our praises well know what were doing right and well repeat it.";	
	var feedbackDefault6 = "A bug can be defined as any fault or defect in the product  layout, functionality.  It can affect both input and output.";	
	var feedbackDefault7 = "An enhancement is any process intended to improve the appearance, functionality or operating efficiency of the product.";	
	var feedbackDefault8 = "An idea is the initial stage of the new-product development process, requiring creativity and innovation to generate ideas for potential new products to be be implemented on the Zawya website.";	
	var tmp = window.document.talk_to_form.comments.value.replace(/,/g,"");
	tmp = tmp.replace(/'/g,"");	
			
	if (window.document.talk_to_form.comments.value.replace(/ /g,"") == "" || tmp == feedbackDefault1 || tmp == feedbackDefault2 || tmp == feedbackDefault3 || tmp == feedbackDefault4 || tmp == feedbackDefault5) {
    document.getElementById("talkError").innerHTML = "Enter your feedback";
    window.document.talk_to_form.comments.focus()
    return false
    }
 	if (window.document.talk_to_form.user_name.value == '') {
	    document.getElementById("talkError").innerHTML = "Enter your name";
	    window.document.talk_to_form.last_name.focus()
	    return false
    }
	if (window.document.talk_to_form.email.value.indexOf('@',0)==-1 ||
       window.document.talk_to_form.email.value.indexOf('@',0)== 0 ||
	   window.document.talk_to_form.email.value.indexOf('/',0)>-1 ||
	   window.document.talk_to_form.email.value.indexOf(':',0)>-1 ||
	   window.document.talk_to_form.email.value.indexOf(',',0)>-1 ||
	   window.document.talk_to_form.email.value.indexOf(';',0)>-1 ||
	   window.document.talk_to_form.email.value.indexOf(' ',0)>-1 ||
       window.document.talk_to_form.email.value.indexOf('.',0)==-1){
    document.getElementById("talkError").innerHTML = "Email address is incorrect"
    window.document.talk_to_form.email.select()
    window.document.talk_to_form.email.focus()
    return false
    }
	return true;
}


function validate_mutual_input(lang) {
	var feedbackDefault1, feedbackDefault2, feedbackDefault3, feedbackDefault4, feedbackDefault5, section_error, feedback_error, name_error, email_error;
	if (lang == "arabic")
	{
		section_error = "أدخل ملاحظاتك";
		feedbackDefault1 = "عندما ترسل لنا أي إقتراح للتحسين أو التغيير، نقوم بإدراج هذا ضمن الإختبارات التي نجريها على منتوجاتنا لنتوصل إلى الحل الأنسب لك.";
		feedbackDefault2 = "عندما ترسل لنا سؤال، يقوم فريق خدمة الزبائن بكل ما هو ممكن للإجابة عن جميع استفساراتك.";
		feedbackDefault3 = "عندما ترسل لنا أي تحديث فسنقوم بإجراء التعديلات المناسبة فوراً.";
		feedbackDefault4 = "عندما ترسل أي شكوى يتم الإتصال بك من قبل فريقنا لحل جميع المسائل.";
		feedbackDefault5 = "عندما ترسلون المديح فإننا نعرف العمل الصحيح الذي قمنا به فنبقي عليه.";	
		name_error = "الرجاء إدخال الإسم";
		feedback_error = "الرجاء إدخال الملاحظة";
		email_error = "البريد الإلكتروني غير صحيح";
	}
	else
	{
		section_error = "Please enter section name";
		feedbackDefault1 = "When you make suggestions for improvements or changes well include this in our regular product testing and updates to provide the best possible solution for you.";
		feedbackDefault2 = "When you ask us a question our customer support team will go out of their way to help clarify any queries you have.";
		feedbackDefault3 = "When you send us an update well quickly amend any changes you request.";
		feedbackDefault4 = "When you complain youll be contacted by our team to help resolve any concerns you may have.";
		feedbackDefault5 = "When you sing our praises well know what were doing right and well repeat it.";	
		name_error = "Enter your name";
		feedback_error = "Enter your feedback";
		email_error = "Email address is incorrect";
	}
	
 	if (document.getElementById("affected_company_name").value == '') {
	    document.getElementById("talkError").innerHTML = section_error;
	    window.document.talk_to_form.affected_company_name.focus()
	    return false
    }
		
	
	var tmp = document.getElementById("comments").value.replace(/,/g,"");
	tmp = tmp.replace(/'/g,"");	
			
	if (document.getElementById("comments").value.replace(/ /g,"") == "" || tmp == feedbackDefault1 || tmp == feedbackDefault2 || tmp == feedbackDefault3 || tmp == feedbackDefault4 || tmp == feedbackDefault5) {
    document.getElementById("talkError").innerHTML = feedback_error;
    document.getElementById("comments").focus()
    return false
    }
 	if (document.getElementById("user_name").value == '') {
	    document.getElementById("talkError").innerHTML = name_error;
	    document.getElementById("last_name").focus()
	    return false
    }
	if (window.document.talk_to_form.email.value.indexOf('@',0)==-1 ||
       document.getElementById("email").value.indexOf('@',0)== 0 ||
	   document.getElementById("email").value.indexOf('/',0)>-1 ||
	   document.getElementById("email").value.indexOf(':',0)>-1 ||
	   document.getElementById("email").value.indexOf(',',0)>-1 ||
	   document.getElementById("email").value.indexOf(';',0)>-1 ||
	   document.getElementById("email").value.indexOf(' ',0)>-1 ||
       document.getElementById("email").value.indexOf('.',0)==-1){
    document.getElementById("talkError").innerHTML = email_error;
    document.getElementById("email").select()
    document.getElementById("email").focus()
    return false
    }
	return true;
}

function clearFeedback1(num,obj,fobj)
{
	for (var i = 0; i < fobj.feedbackType.length; i ++)
		if (fobj.feedbackType[i].checked == true)
			switch (i)
			{
				case 0:
					var feedbackDefault = "When you make suggestions for improvements or changes, we'll include this in our regular product testing and updates to provide the best possible solution for you.";
					break;
				case 1:
					var feedbackDefault = "When you ask us a question, our customer support team will go out of their way to help clarify any queries you have.";
					break;
				case 2:
					var feedbackDefault = "When you send us an update we'll quickly amend any changes you request.";
					break;
				case 3:
					var feedbackDefault = "When you complain you'll be contacted by our team to help resolve any concerns you may have.";			
					break;
				case 4:
					var feedbackDefault = "When you sing our praises we'll know what we're doing right and we'll repeat it.";	
					break;
				case 5:
					var feedbackDefault = "An idea is the initial stage of the new-product development process, requiring creativity and innovation to generate ideas for potential new products to be be implemented on the Zawya website.";	
					break;
				case 6:
					var feedbackDefault = "A bug can be defined as any fault or defect in the product  layout, functionality.  It can affect both input and output.";	
					break;
				case 7:
					var feedbackDefault = "An enhancement is any process intended to improve the appearance, functionality or operating efficiency of the product.";	
					break;
			}
	if (num == 1 && obj.value == feedbackDefault)
		obj.value = "";
	else if (num == 2 && obj.value == "")
		obj.value = feedbackDefault;
}

function SwitchFeedbackType1(num,field)
{
	tmp = window.document.getElementById(field).value;
	if( tmp == "When you make suggestions for improvements or changes, we'll include this in our regular product testing and updates to provide the best possible solution for you."
		|| tmp == "When you ask us a question, our customer support team will go out of their way to help clarify any queries you have."
		|| tmp == "When you send us an update we'll quickly amend any changes you request."
		|| tmp == "When you complain you'll be contacted by our team to help resolve any concerns you may have."
		|| tmp == "When you sing our praises we'll know what we're doing right and we'll repeat it."
		|| tmp == "An idea is the initial stage of the new-product development process, requiring creativity and innovation to generate ideas for potential new products to be be implemented on the Zawya website."
		|| tmp == "A bug can be defined as any fault or defect in the product  layout, functionality.  It can affect both input and output."
		|| tmp == "An enhancement is any process intended to improve the appearance, functionality or operating efficiency of the product."
		|| trim(tmp) == ""){		
		switch (num)
		{
			case 1:
				window.document.getElementById(field).value = "When you make suggestions for improvements or changes, we'll include this in our regular product testing and updates to provide the best possible solution for you.";
				break;
			case 2:
				window.document.getElementById(field).value = "When you ask us a question, our customer support team will go out of their way to help clarify any queries you have.";
				break;
			case 3:
				window.document.getElementById(field).value = "When you send us an update we'll quickly amend any changes you request.";
				break;
			case 4:
				window.document.getElementById(field).value = "When you complain you'll be contacted by our team to help resolve any concerns you may have.";
				break;
			case 5:
				window.document.getElementById(field).value = "When you sing our praises we'll know what we're doing right and we'll repeat it.";	
				break;
			case 6:
				window.document.getElementById(field).value = "An idea is the initial stage of the new-product development process, requiring creativity and innovation to generate ideas for potential new products to be be implemented on the Zawya website.";	
				break;
			case 7:
				window.document.getElementById(field).value = "A bug can be defined as any fault or defect in the product  layout, functionality.  It can affect both input and output.";	
				break;
			case 8:
				window.document.getElementById(field).value = "An enhancement is any process intended to improve the appearance, functionality or operating efficiency of the product.";	
				break;
		}
	}
}

function submitFeedBack1(url,fObj,callBack)
{
	var feedbackDefault1 = "When you make suggestions for improvements or changes well include this in our regular product testing and updates to provide the best possible solution for you.";
	var feedbackDefault2 = "When you ask us a question our customer support team will go out of their way to help clarify any queries you have.";
	var feedbackDefault3 = "When you send us an update well quickly amend any changes you request.";
	var feedbackDefault4 = "When you complain youll be contacted by our team to help resolve any concerns you may have.";
	var feedbackDefault5 = "When you sing our praises well know what were doing right and well repeat it.";	
	var feedbackDefault6 = "A bug can be defined as any fault or defect in the product  layout, functionality.  It can affect both input and output.";	
	var feedbackDefault7 = "An enhancement is any process intended to improve the appearance, functionality or operating efficiency of the product.";	
	var feedbackDefault8 = "An idea is the initial stage of the new-product development process, requiring creativity and innovation to generate ideas for potential new products to be be implemented on the Zawya website.";
	var tmp = fObj.feedback.value.replace(/,/g,"");
	tmp = tmp.replace(/'/g,"");
	if (fObj.feedback.value.replace(/ /g,"") == "" || tmp == feedbackDefault1 || tmp == feedbackDefault2 || tmp == feedbackDefault3 || tmp == feedbackDefault4 || tmp == feedbackDefault5)
	{
		window.document.getElementById("feedBackError").innerHTML = "Enter your feedback";
		return false
	}
	else if (!checkEmail(fObj.email.value))
	{
		window.document.getElementById("feedBackError").innerHTML = "Email address is incorrect";
		return false;
	}
	form_postForPlainText(url,fObj,callBack);	
	window.document.getElementById("feedBackForm").innerHTML = '<div class="loadimg"><img src="/images/LoadingData.gif" border="0" style="vertical-align:middle"> <font class="greytextsmall">Sending ...</font></div>';
	return false;	
}

var openImgpro = new Image();
openImgpro.src = "/images/cm_ico_expanded.GIF";
var closedImgPro = new Image();
closedImgPro.src = "/images/cm_ico_collapse.GIF";
var openImgpro2 = new Image();
openImgpro2.src = "/images/butt_zic_collapse.GIF";
var closedImgPro2 = new Image();
closedImgPro2.src = "/images/butt_zic_expand.GIF";


function swapFolder2(img)
{
	objImgPro = document.getElementById(img);
	if(objImgPro.src.indexOf('/images/cm_ico_collapse.GIF')>-1)
		objImgPro.src = openImgpro.src;
	else
		objImgPro.src = closedImgPro.src;
}

function openHideRow(show,hide)
{
			document.getElementById(hide).className = "gone";
			document.getElementById(show).className = "notgone";
}


function openallrows(sector,img)
{
	// STORE ALL <tr> ELEMENTS IN AN ARRAY.
var allTrElements = document.getElementsByTagName("tr");
	objImgPro = document.getElementById(img);
		var expd='expand';
		if(objImgPro.src.indexOf('/images/cm_ico_collapse.GIF')>-1)
			expd='expand';
		else
			expd='collapse';
// LOOP THROUGH ALL <tr> ELEMENTS ON THE PAGE.
	for ( var i=0; i < allTrElements.length; i++ )
	{	
		// SET THE CURRENT <tr> ELEMENT TO A VARIABLE.
		var tr = allTrElements[i];
		// IF THE CURRENT <tr> HAS AN id ATTRIBUTE
		// THAT have the sector attribute THEN PROCEED.

		if ( tr.id.search(sector) != -1 )
		{
			
			if(expd=='collapse')
			{
				
				objImgPro.src = closedImgPro.src;
				if ( tr.id.search('expanded') != -1 )
					document.getElementById(tr.id).className = "gone";
				if ( tr.id.search('collapsed') != -1 )
					document.getElementById(tr.id).className = "notgone";
			}
			else
			{
				objImgPro.src = openImgpro.src;
				if ( tr.id.search('collapsed') != -1 )
					document.getElementById(tr.id).className = "gone";
				if ( tr.id.search('expanded') != -1 )
					document.getElementById(tr.id).className = "notgone";
			}

		}
	
	}
	
}

function hideshowallrows(sector,img)
{
	// STORE ALL <tr> ELEMENTS IN AN ARRAY.
var allTrElements = document.getElementsByTagName("tr");
	objImgPro = document.getElementById(img);
		var expd='expand';
		if(objImgPro.src.indexOf('/images/cm_ico_collapse.GIF')>-1)
			expd='expand';
		else
			expd='collapse';
// LOOP THROUGH ALL <tr> ELEMENTS ON THE PAGE.


	for ( var i=0; i < allTrElements.length; i++ )
	{	
		// SET THE CURRENT <tr> ELEMENT TO A VARIABLE.
		var tr = allTrElements[i];
		// IF THE CURRENT <tr> HAS AN id ATTRIBUTE
		// THAT have the sector attribute THEN PROCEED.

		if ( tr.id.search('sec' + sector) != -1 )
		{
			
			if(expd=='collapse')
			{
				
				objImgPro.src = closedImgPro.src;
				if( document.getElementById(tr.id).className == "notgone")
					document.getElementById(tr.id).className = "gone";
				else
					document.getElementById(tr.id).className = "notgone";


			}
			else
			{
				objImgPro.src = openImgpro.src;
				if( document.getElementById(tr.id).className == "notgone")
					document.getElementById(tr.id).className = "gone";
				else
					document.getElementById(tr.id).className = "notgone";

			}

		}
	
	}

	
}


function openallSectors(img)
{
	// STORE ALL <tr> ELEMENTS IN AN ARRAY.
var allTrElements = document.getElementsByTagName("tr");
		objImgPro2 = document.getElementById(img);
		var expd='expand';
		if(objImgPro2.src.indexOf('/images/butt_zic_expand.GIF')>-1)
			expd='expand';
		else
			expd='collapse';
// LOOP THROUGH ALL <tr> ELEMENTS ON THE PAGE.
	for ( var i=0; i < allTrElements.length; i++ )
	{	
		// SET THE CURRENT <tr> ELEMENT TO A VARIABLE.
		var tr = allTrElements[i];
		// IF THE CURRENT <tr> HAS AN id ATTRIBUTE
		// THAT have the sector attribute THEN PROCEED.
		if(expd=='collapse')
		{
			objImgPro2.src = closedImgPro2.src;
			if ( tr.id.search('expanded') != -1 )
				document.getElementById(tr.id).className = "gone";
			if ( tr.id.search('collapsed') != -1 )
				document.getElementById(tr.id).className = "notgone";
		}
		else
		{
			objImgPro2.src = openImgpro2.src;
			if ( tr.id.search('collapsed') != -1 )
				document.getElementById(tr.id).className = "gone";
			if ( tr.id.search('expanded') != -1 )
				document.getElementById(tr.id).className = "notgone";
		}
	
	}
	
}
function validateBCLform(fobj){
	with(window.document)
	{
		if (getElementById("country").options[getElementById("country").options.selectedIndex].value == "" && getElementById("country").options[getElementById("ownership").options.selectedIndex].value == "" && getElementById("sectorsindustry").value == "")
		{
			alert("Please select a search criteria");
			return false;	
		}
	}			
}


function setDefinition(text){
	text=text.replace(/<.*?>/g,'');
	window.document.getElementById('defdiv').innerHTML = text;
}

function compare(page,cgi,type,company,currency){
	document.compareform.action=cgi+"?companyid="+company+"&section="+page+"&type="+type+"&currency="+currency+"&start=1";
    document.compareform.target = "_self";
		document.compareform.submit();
}

function clearFeedbackArabic(num,obj,fobj)
{
	for (var i = 0; i < fobj.feedbackType.length; i ++)
		if (fobj.feedbackType[i].checked == true)
			switch (i)
			{
				case 0:
					var feedbackDefault = "عندما ترسل لنا أي إقتراح للتحسين أو التغيير، نقوم بإدراج هذا ضمن الإختبارات التي نجريها على منتوجاتنا لنتوصل إلى الحل الأنسب لك.";
					break;
				case 1:
					var feedbackDefault = "عندما ترسل لنا سؤال، يقوم فريق خدمة الزبائن بكل ما هو ممكن للإجابة عن جميع استفساراتك.";
					break;
				case 2:
					var feedbackDefault = "عندما ترسل لنا أي تحديث فسنقوم بإجراء التعديلات المناسبة فوراً.";
					break;
				case 3:
					var feedbackDefault = "عندما ترسل أي شكوى يتم الإتصال بك من قبل فريقنا لحل جميع المسائل.";			
					break;
				case 4:
					var feedbackDefault = "عندما ترسلون المديح فإننا نعرف العمل الصحيح الذي قمنا به فنبقي عليه.";	
					break;
			}
	if (num == 1 && obj.value == feedbackDefault)
		obj.value = "";
	else if (num == 2 && obj.value == "")
		obj.value = feedbackDefault;
}

function SwitchFeedbackTypeArabic(num,field)
{
	tmp = window.document.getElementById(field).value;
	if( tmp == "عندما ترسل لنا أي إقتراح للتحسين أو التغيير، نقوم بإدراج هذا ضمن الإختبارات التي نجريها على منتوجاتنا لنتوصل إلى الحل الأنسب لك."
		|| tmp == "عندما ترسل لنا سؤال، يقوم فريق خدمة الزبائن بكل ما هو ممكن للإجابة عن جميع استفساراتك."
		|| tmp == "عندما ترسل لنا أي تحديث فسنقوم بإجراء التعديلات المناسبة فوراً."
		|| tmp == "عندما ترسل أي شكوى يتم الإتصال بك من قبل فريقنا لحل جميع المسائل."
		|| tmp == "عندما ترسلون المديح فإننا نعرف العمل الصحيح الذي قمنا به فنبقي عليه."
		|| trim(tmp) == ""){		
		switch (num)
		{
			case 1:
				window.document.getElementById(field).value = "عندما ترسل لنا أي إقتراح للتحسين أو التغيير، نقوم بإدراج هذا ضمن الإختبارات التي نجريها على منتوجاتنا لنتوصل إلى الحل الأنسب لك.";
				break;
			case 2:
				window.document.getElementById(field).value = "عندما ترسل لنا سؤال، يقوم فريق خدمة الزبائن بكل ما هو ممكن للإجابة عن جميع استفساراتك.";
				break;
			case 3:
				window.document.getElementById(field).value = "عندما ترسل لنا أي تحديث فسنقوم بإجراء التعديلات المناسبة فوراً.";
				break;
			case 4:
				window.document.getElementById(field).value = "عندما ترسل أي شكوى يتم الإتصال بك من قبل فريقنا لحل جميع المسائل.";
				break;
			case 5:
				window.document.getElementById(field).value = "عندما ترسلون المديح فإننا نعرف العمل الصحيح الذي قمنا به فنبقي عليه.";	
				break;
		}
	}
}



function togCollapseExpand_bcl(divid) {
	el = document.getElementById(divid);
	el.className = el.className.indexOf('collapse') != -1 ? el.className.replace(/collapse/,'expand') : el.className.replace(/expand/,'collapse');
	return false;
}
function submit_feedback_bcl(frm,btn,diverror,filesrc,testotherinputs) {
	with(frm) {
		if (testotherinputs)
		{
			if(name.value.replace(/ /gi,'') == '') {
				alert('Please enter your name.');
				name.focus();
				return false;
			}
			if(email.value.replace(/ /gi,'') == '' || email.value.indexOf(".",email.value.indexOf("@")+2) <= 0) {
				alert('Please enter your email.');
				email.focus();
				return false;
			}
		}
		if(feedbackcomments.value.replace(/ /gi,'') == '') {
			alert('Please enter comments.');
			feedbackcomments.focus();
			return false;
		}
	}
	form_postForPlainText(filesrc,frm,callLoadPage_bcl,null,btn,diverror);
	return false;
}
function callLoadPage_bcl(text,callingContext,headers,arrParams) {
	window.document.getElementById(callingContext).innerHTML = text;
	setJSFunctions(callingContext,text);
}
function putClass_bcl(divid,clsnm) {
	document.getElementById(divid).className = clsnm;
	return false;
}


function ExternalInterfaceManager() {
	this.registerMovie = function(movieName) {
		if(!window.fakeMovies) window.fakeMovies = new Array();
		window.fakeMovies[window.fakeMovies.length] = movieName;
	}
	this.initialize = function() {
		if(document.all) {
			if(window.fakeMovies) {
				for(i=0;i < window.fakeMovies.length;i++) {
					window[window.fakeMovies[i]] = new Object();
				}
				window.onload = initializeExternalInterface;
			}
		}
	}
}

function initializeExternalInterface() {
	for(i=0;i<window.fakeMovies.length;i++) {
		var movieName = window.fakeMovies[i];
		var fakeMovie = window[movieName];
		var realMovie = document.getElementById(movieName);
		for(var method in fakeMovie) {
			realMovie[method] = function() {flashFunction = "<invoke name=\"" + method.toString() + "\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments, 0) + "<invoke>";
			this.CallFunction(flashFunction);}
		}
		window[movieName] = realMovie;
	}
}

function popcriteria(show,id)
{
	if (show)
		document.getElementById(id).className = "notgone";
	else 
		document.getElementById(id).className = "gone";
}

function closepopup()
{
	document.getElementById('selecDiv').className='gone';
	document.getElementById('relateddiv').className='gone';
	document.getElementById('relateddiv').innerHTML='';
	document.getElementById('loadercontent').className='gone';
	return false;
}

function searchpopup()
{
		showSearchForm(document.getElementById('filtername').value);
		document.getElementById('relateddiv').innerHTML='';
		document.getElementById('relateddiv').className='gone';
		return false;
	}
	
function	popupanalytics()

{
		if(document.getElementById('popupanalytics').className=='gone')
			document.getElementById('popupanalytics').className='notgone';
		else
			document.getElementById('popupanalytics').className='gone';
}

function popupDetails()
{
	window.open("Analytics-popup.cfm", "Expanded/Detailed view", "width=432,height=500,resizable=yes,scrollbars=yes");
}

function submit_bcl_feedback(frm,btn)
{
	with(window.document) {
		if(getElementById("bclfeedback_dummy").value.replace(/ /gi,'') == '') {
			alert('Please enter your feedback.');
			getElementById("bclfeedback_dummy").focus();
			btn.className='notgone'; 
			putClass('fbimgloader','gone');
			return false;
		}	
		getElementById("bclfeedback").value = getElementById("bclfeedback_dummy").value;
		btn.className='gone'; 
		putClass('fbimgloader','notgone'); 
		form_postForPlainText('/cm/analytics/xml.cfm?submitbclfeedback',frm,loadData,null,btn,'bclfeedbackerror');
	}
	return false;
}

function showdefin(secid)
{
		with(window.document) {
			getElementById('defdivid').className = "notgone";
			var divid1 = 'def'+secid;
			var definition = getElementById(divid1).innerHTML;
			getElementById("definitiondiv").innerHTML=definition;
		}
}
