
var sub_opened = null;

var selected_link = null;

var ajaxready = false;

var pageid = 0;

var sectionid = 0;

var IE = document.all;



var DTIT="Dar Al-Arkan Real Estate Co. Real Estate Development, Kingdom of Saudi Arabia";



function getId(obj) {

	return $(obj).attr("id") ? $(obj).attr("id") : "0";	

}



function toggle(id) {



	if (getId(sub_opened) == "sub_" + id) return;



	if (sub_opened) {

		

		var parent = $("#nav_" + getId(sub_opened).substr(4));

		if (parent) {

			$(parent).removeClass("nav1selected");		

		}

		sub_opened.slideUp();

	}

	

	sub_opened = $('#sub_' + id);

	sub_opened.slideDown();

	

	var n = $('#nav_' + id);

	n.addClass("nav1selected");
	
	 n = $('#nav_37');
	n.removeClass("nav1selected");
	n.addClass("nav1");	
	
	
	 n = $('#nav_45');
	 n.removeClass("nav1selected");
	n.addClass("nav1");		
	


}

function toggle_cg(id){



	if (getId(sub_opened) == "sub_" + id) return;



	if (sub_opened) {

		

		var parent = $("#nav_" + getId(sub_opened).substr(4));

		if (parent) {

			$(parent).removeClass("nav1selected");		

		}

		sub_opened.slideUp();

	}


	sub_opened = null;
	
	 n = $('#nav_37');
	n.removeClass("nav1selected");
	n.addClass("nav1");	
	
	
	 n = $('#nav_45');
	 n.removeClass("nav1selected");
	n.addClass("nav1");		


	


	




}


function navigate2(sid, id) {
    

    
	if (!ajaxready) return true;



    try {

	    if (selected_link) {

	        var __id = $(selected_link).attr("id").substr(2);

	        if (id != __id) {

		        selected_link.removeClass("nav3selected");		

		    }

	    }

    	

	    selected_link = $("#n_" + id);

	    selected_link.addClass("nav3selected");

    

    } catch (ex) { } 

		

	window.location.hash = "/" + sid + "/" + id;

	

	LoadPage(id);

	change_banner();
   keep_title();
    //alert(document.title);
	return false;

}


function navigate(sid, id) {


    
	if (!ajaxready) return true;



    try {

	    if (selected_link) {

	        var __id = $(selected_link).attr("id").substr(2);

	        if (id != __id) {

		        selected_link.removeClass("nav3selected");		

		    }

	    }

    	

	    selected_link = $("#n_" + id);

	    selected_link.addClass("nav3selected");

    

    } catch (ex) { } 

		
   
	window.location.hash = "/" + sid + "/" + id;

	

	LoadPage(id);

	change_banner();
    
   keep_title();
	return false;

}

function navigate3(sid, id) {


    
	if (!ajaxready) return true;



    try {

	    if (selected_link) {

	        var __id = $(selected_link).attr("id").substr(2);

	        if (id != __id) {

		        selected_link.removeClass("nav3selected");		

		    }

	    }

    	

	    selected_link = null
	    //selected_link.addClass("nav3selected");

    

    } catch (ex) { } 

		
   
	window.location.hash = "/" + sid + "/" + id;

	

	LoadPage(id);

	change_banner();
    
   keep_title();
	return false;

}


function keep_title(){
document.title=DTIT;

}
function keep_title2(addedvalue){
document.title=DTIT+", "+ addedvalue;

}

function LoadPage(id, sid) {

    pageid = id;

    sectionid = sid;

    show_loader();
    make_bottom_roll(id);

	$('#main').load("ajax.aspx", {id: id, sid: sid, lang: lang},keep_title());

	

}



function pageload(hash) {

		// hash doesn't contain the first # character.

		

	if (hash && hash != "") {

		hash = hash.substr(1);

		// find the link that has this:

		var components = hash.split("/");

		

		var container = $("#n_" + components[1]);

		var section = $("#nav_" + components[0]);

		

		if (section) {

			if (sub_opened && getId(sub_opened) != "sub_" + components[0]) {

				var parent = $("#nav_" + getId(sub_opened).substr(4));

				if (parent) {

					$(parent).removeClass("nav1selected");		

				}

				sub_opened.slideUp();

			}

			

			

			$(section).addClass("nav1selected");

			

			sub_opened = $('#sub_' + components[0]);

			sub_opened.slideDown();			

			

		}

		

		if (container) {

			

			if (selected_link) {

				selected_link.removeClass("nav3selected");		

			}

						

			

			selected_link = $(container);

			$(selected_link).addClass("nav3selected");

		}

		

		LoadPage(components[1], components[0]);

	

	} else {

		setTimeout(function() { initContents();}, 1);

	}

}



function initPage() {

	$("#loading").ajaxStart(function(){ 

		$(this).fadeIn();	 });
	

	$("#loading").ajaxSuccess(function(evt, request, settings){

	   $(this).fadeOut();

	 });

	

	

	$.historyInit(pageload);



	

	ajaxready = true;

	

	// check if there is a hash.

	var hash = window.location.hash;

	pageload(hash.substr(1))

	

	$('#main').ajaxSuccess(function(evt, request, settings){

	   setTimeout(function() { initContents();}, 1);

	 });

}



function show_loader(){

document.getElementById('main').innerHTML='<table width="100%" border="0" cellpadding="20"><tr><td align="center"><img src="images/bloader.gif" border="0" align="center" class="skip"  /></td></tr></table>';

}
function make_bottom_roll(id){
	var btg="bottom_sm_"+id;	
	$('#footer a').removeClass('fihawbaleha');	
	cngbg(btg,'fihawbaleha');
}



function initContents() {

    

    // remove the lower section cause this is not the homepage.

    if (pageid != 0) {

        $("#lower").hide();

    }

    

    initFriendlyLinks();

    initGallery();

	initNews();

	initFaq();

	initCareers();

	initContact();

	initSitemap();

	

	try {

	    initProjects();

	} catch(ex) {}



	

 //   if (IE) return; // TODO: fix IE problem with this.



	var images = $("#main img");

	jQuery.each(images, function(index, value) {

			 

		if ($(value).hasClass("skip")) {

			return;

		}								 



		var align = $(value).attr("align");

		if (align == "") {

		    align = $(value).css("float");

		}		

		

		var w = $(value).attr("width");

		var h = $(value).attr("height");

		

		var td = document.createElement("td");

		td.innerHTML = "<img class='skip' src='images/curl.gif' />";

		$(td).css("background-image", "url('" + $(value).attr("src") + "')");


		//$(value)

		$(value).replaceWith(td);

		$(td).attr("align", "right").attr("valign", "top");

	

		$(td).wrap("<tr></tr>").parent().wrap("<table></table>").parent().parent()

			.attr("width", w).attr("height", h).attr("align", align).attr("cellspacing", 0).attr("cellpadding", 0)

			.attr("border", 0).addClass("imagewrapper").addClass(align == "right" ? "wrapperright" : "");



	 });

}





$(document).ready(function() { initPage(); });



var curfaq = null;

function initFaq() {



    $(".question").hover(function() {

        $(this).addClass("question_active");

    }, function() {

        $(this).removeClass("question_active");

    });

    

    $(".question").unbind("click");

    $(".question").click(function() {

        $(curfaq).parent("td").children(".answer").slideUp(80);

        if (curfaq == this) {

            curfaq = null;

            return;

        }

        curfaq = this;

        $(this).parent("td").children(".answer").slideDown(80);

    });

}



var curcareers = 0;

function initCareers() {

	

	$(".careerentry a, .careerentry2 a").each(function (i, val) {

		$(val).unbind("click");

		$(val).click(function() {

			var href = this.href.split("#")[1];

			if (curcareers == href) {

				curcareers = 0;

				$("#career_" + href).slideUp();

				$(this).parent(".careerentry").removeClass("careerentry_over");

				$(this).parents(".careerunit").children(".careerentry2").removeClass("careerentry2_over");

				$(this).parent(".careerentry2").removeClass("careerentry2_over");

			    $(this).parents(".careerunit").children(".careerentry").removeClass("careerentry_over");

			} else {

				

				$("#career_link_" + curcareers).click();

				

				$("#career_" + href).slideDown();

				curcareers = href;

			}

			return false;							   

		});

	});

	

	

	$(".careerentry, .careerentry2").hover(

	function() {

	    $(this).parent().children(".careerentry").addClass("careerentry_over");

	    $(this).parent().children(".careerentry2").addClass("careerentry2_over");

	    

	}, 

	

	function() {

	    $(this).parent().children(".careerentry").removeClass("careerentry_over");

	    $(this).parent().children(".careerentry2").removeClass("careerentry2_over");

	}

	);

	

	

	

	

	$(".careerentry a").hover(function() {

		var href = this.href.split("#")[1];

		if (curcareers == href) return;

		$(this).parent(".careerentry").addClass("careerentry_over");

		$(this).parents(".careerunit").children(".careerentry2").addClass("careerentry2_over");

   }, function() {

	   var href = this.href.split("#")[1];

		if (curcareers == href) return;

	   $(this).parent(".careerentry").removeClass("careerentry_over");

	   $(this).parents(".careerunit").children(".careerentry2").removeClass("careerentry2_over");

   });

	$(".careerentry2 a").hover(function() {

		var href = this.href.split("#")[1];

		if (curcareers == href) return;

		$(this).parent(".careerentry2").addClass("careerentry2_over");

		$(this).parents(".careerunit").children(".careerentry").addClass("careerentry_over");

   }, function() {

	   var href = this.href.split("#")[1];

		if (curcareers == href) return;

	   $(this).parent(".careerentry2").removeClass("careerentry2_over");

	   $(this).parents(".careerunit").children(".careerentry").removeClass("careerentry_over");

   });

}



var mainstrat='strat_part';



function inverse_classi(cls){

    if(cls=="strat_part"){return "strat_proj";}

    if(cls=="strat_proj"){return "strat_part";}

}







function setStrategicPartners0() {

	$("#strat_container").removeClass("stratno");

	$("#strat_container").addClass("strat part");	

	

	return false;

}



function setStrategicProjects0() {

    $("#strat_container").removeClass("stratno");

	$("#strat_container").addClass("strat part");

	

	return false;

}





function setStrategicPartners() {

	$("#strat_container").addClass("strat_proj");

	$("#strategicstuff").html("Partners");

	return false;

}



function setStrategicProjects() {

	$("#strat_container").addClass("strat_proj");

	$("#strategicstuff").html("Projects");

	return false;

}





function setStrategicPartners2() {

    $("#strat_container").removeClass("strat_proj");

	var str="strategic_"+1;
	document.getElementById(str).style.display="inline";
	var str="strategic_"+2;
	document.getElementById(str).style.display="none";	

	cngbg('st2','stratno');
	cngbg('st1','stratyes');

	return false;

}



function setStrategicProjects2() {

    $("#strat_container").addClass("strat_proj");

	var str="strategic_"+1;
	document.getElementById(str).style.display="none";

	var str="strategic_"+2;
	document.getElementById(str).style.display="inline";

	cngbg('st1','stratno');
	cngbg('st2','stratyes');	

	return false;

}



function R(obj) {

    var td = obj.offsetParent;

   

    $(td).addClass("curled");

}



function U(obj) {

    var td = obj.offsetParent;

   

    $(td).removeClass("curled");

}



function R2(objname) {

    var obj=document.getElementById(objname);

    var td = obj.offsetParent;

   

    $(td).addClass("curled");

}



function U2(objname) {

    var obj=document.getElementById(objname);

    var td = obj.offsetParent;

   

    $(td).removeClass("curled");

}



function initFriendlyLinks() {

    $(".friendly_link").hover(function() { 

        $(this).addClass("link_hovered");    

    } ,function() { 

        $(this).removeClass("link_hovered");    

    } );

    

}



var project_top = 1;

function initProjects() {
	/*for (var i= 4; i<= totalprojects; i++) {

	

		$("#project_" + i).hide();	

	}*/

	

	/*$("#spup").click(function() {

	    project_top--;

	    if (project_top < 1) project_top = 1;

	    scrollProjects();

	});*/

	

	/*$("#spdown").click(function() {

	    project_top++;

	    if (project_top > totalprojects - 2) project_top = totalprojects - 2;

	    scrollProjects();

	});*/

	

	

	$(".projectbutton").click(function() {

	    var href = this.href.split("?")[1];

	   

	    if (href) {

	        

	        var fields = href.split("&");

	        for (var i in fields) {

	            var v = fields[i].split("=");

	            if (v[0] == "project") {

	                showProject(v[1]);

	                return false;

	            }

	        }

	    }

	    

	    return true;

	});

	

}



function scrollProjects() {

    for (var i= 1; i<= totalprojects; i++) {

        if (i < project_top || i > project_top + 2) {

            $("#project_" + i).slideUp();	

        } else {

            $("#project_" + i).slideDown();	

        }

        

	}

}

function showProject3(sectionid,pageid,id) {    
    $("#main").load("ajax.aspx", {id: pageid, sid: sectionid, project: id});    

}

function showProject(id) {



    $("#main").load("ajax.aspx", {id: pageid, sid: sectionid, project: id});    

}
function showProject2(sectionid,pageid,id) {
    show_loader();
    $("#main").load("ajax.aspx", {id: pageid, sid: sectionid, project: id});    

}
function showProject2__(sectionid,pageid,id) {
    show_loader();
    $("#main").load("ajax.aspx", {id: pageid, sid: sectionid, project: id,backhome:"yes"});    

}


function showGallery2(id,sid,pid){

    show_loader();
    $("#main").load("ajax.aspx", {id: pid, sid: sid, gallery: id});    

}


function showGallery3(id,sid,pid){

    
    $("#main").load("ajax.aspx", {id: pid, sid: sid, gallery: id});    

}


function showNews2(id,sid,pid){
    try{
    show_loader();
    $("#main").load("ajax.aspx", {id: pid, sid: sid, newsid: id});    
    }
    catch(e){}

}


function showNews_pp(iid,sid,pid){
    try{
    show_loader();
    $("#main").load("ajax.aspx", {id: pid, sid: sid, inewsid: iid});    
    }
    catch(e){}

}

function showNews_pp_p(iid,sid,pid){
    try{
    show_loader();
    $("#main").load("ajax.aspx", {id: pid, sid: sid, p_inewsid: iid});    
    }
    catch(e){}

}

function showNews4(id,sid,pid){
    try{
    
    $("#main").load("ajax.aspx", {id: pid, sid: sid, newsid: id});    
    }
    catch(e){}

}

function showNews2__(id,sid,pid){

    show_loader();
    $("#main").load("ajax.aspx", {id: pid, sid: sid, newsid: id,backhome:"yes"});    

}

function showNews3(id,sid,pid,type){

    show_loader();
    $("#main").load("ajax.aspx", {id: pid, sid: sid, newsid: id,typeid:type});    

}
function showNews3_(sid,pid,type){

    show_loader();
    $("#main").load("ajax.aspx", {id: pid,sid: sid,typeid:type});    

}
function hideAll() {

    for (var i= 1; i<= totalprojects; i++) {

        $("#project_info_" + i).hide();

    }

}



var inited = false;

function initGallery() {

	

	/*

	

	if (inited) return;

	inited = true;



	$(".galbutton").click(function() {

								 

	    var href = this.href.split("?")[1];

	   

	    if (href) {

	        

	        var fields = href.split("&");

	        for (var i in fields) {

	            var v = fields[i].split("=");

	            if (v[0] == "gallery") {

					

					if ($(this).hasClass("button_hover")) {

		                hideGallery(v[1]);

						$(this).removeClass("button_hover");	

						$(this).html("open gallery");

					} else {

		                showGallery(v[1]);

						$(this).addClass("button_hover");

						$(this).html("close gallery");

					}

	                return false;

	            }

	        }

	    }

	    		

	    return true;

	});

	*/

}



function galClick(_this,str1,str2) {

    var href = _this.href.split("?")[1];
    if (href) {
        var fields = href.split("&");
        for (var i in fields) {
            var v = fields[i].split("=");
            if (v[0] == "gallery") {
			    if ($(_this).hasClass("button_hover")) {
                    hideGallery(v[1]);
				    $(_this).removeClass("button_hover");	
				    $(_this).html(str1);
			    } else {
                    showGallery(v[1]);
				    $(_this).addClass("button_hover");
				    $(_this).html(str2);
			    }
                return false;
            }
        }
    }
    return true;
}

function exhClick(_this,str1,str2) {

								 

    var href = _this.href.split("?")[1];



    if (href) {

        

        var fields = href.split("&");

        for (var i in fields) {

            var v = fields[i].split("=");

            if (v[0] == "gallery") {

    			

			    if ($(_this).hasClass("button_hover")) {

                    hideGallery(v[1]);

				    $(_this).removeClass("button_hover");	

				    $(_this).html(str1);

			    } else {

                    showGallery(v[1]);

				    $(_this).addClass("button_hover");

				    $(_this).html(str2);

			    }

                return false;

            }

        }

    }    		

    return true;

}



function showGallery(id) {

	$("#gal_" + id).slideDown();	

}



function hideGallery(id) {

	$("#gal_" + id).slideUp();	

}





var innews = false;

function initNews() {

	

	$(".news").hover(

	function() {

		$(this).children(".newstitle").addClass("newstitle_hovered");

	  }, 

	  function() {

		  if (!innews) 

		  	$(this).children(".newstitle").removeClass("newstitle_hovered");

	  }

	);

	

	$(".news .newsmore").click(function() {
        
        

        
	    var href = this.href.split("?")[1];

	   

	    if (href) {

	        

	        var fields = href.split("&");

	        for (var i in fields) {

	            var v = fields[i].split("=");

	            if (v[0] == "news") {
                    //alert(v[1]);
                    $("#olddown" +  v[1]).hide();
					hideAllNews(v[1]);

					$("#news_brief_" + v[1]).slideUp(function() {

					$("#news_" + v[1]).slideDown(function() { 

					    $('html,body').animate({scrollTop: $("#main").offset().top}, 1000);

					    

					});

					});

					
                    
					innews = true;

					$(this).parent("news").children(".newstitle").addClass("newstitle_hovered");

					

	                return false;

	            }

	        }

	    }

	    		

	    return true;

	});

	

	$(".newsback").click(function() {

		showAllNews();
		
	    var href = this.href.split("?")[1];
	    if (href) {
	        var fields = href.split("&");
	        for (var i in fields) {
	            var v = fields[i].split("=");
	            if (v[0] == "id") {
                    $("#olddown" +  v[1]).show();
                   }
            }
         }		

		return false;

  });

}





function hideAllNews(except) {

	for (var i = 1; i <= maxnews; i++) {

		if (i != except) {

			$("#news_" + i).parent(".news").slideUp();

		}

	}

}





function showAllNews() {

	innews = false;

	$(".newstitle").removeClass("newstitle_hovered");

	for (var i = 1; i <= maxnews; i++) {

		$("#news_" + i).parent(".news").slideDown();

		$("#news_brief_" + i).slideDown();

		$("#news_" + i).slideUp();

	}

	

}



function initContact() {



    $("#contact").bind("submit", function() {

        

        var data = {lang: lang};

        var arr = ["fullname", "email", "phone", "country", "comments"];

        for (var i in arr) {

            try {

                data[arr[i]] = $("#" + arr[i]).get(0).value;

            } catch(Ex) {

                data[arr[i]] = "n/a";

            }

        }



        $("#contact_div").load("contact.aspx", data);

        

        return false;

    });





}



function initSitemap() {

    $(".sitemap_1 a").unbind("click");

    $(".sitemap_1 a").click(function() {

        

        var href = this.href.split("?")[1];

	   

	    if (href) {

	        

	        var fields = href.split("&");

	        

	        var _section = 0;

	        var _page = 0;

	        var _project = 0;

	        

	        for (var i in fields) {

	            var v = fields[i].split("=");

	            if (v[0] == "page") {

					_page = v[1];

	            } else if (v[0] == "section") {

	                _section = v[1];

	            } else if (v[0] == "project") {

	                _project = v[1];

	            }

	        }

	        

	        if (_project > 0) {

	            pageid = _page;

	            sectionid = _section;

	            showProject(_project);

	        } else {

	            navigate(_section, _page);

	        }

	        

	        return false;

	    }

    

        return true;

    });

}









function D(n) { return document.getElementById(n); } 



function rolloverMe(a)

{



try {	

	D("name_" + a).className ='investor_anaylst_namesel';

	D("company_" + a).className ='investor_anaylst_namesel';

	D("email_" + a).className ='investor_anaylst_namesel';

	D("arrow_" + a).style.visibility ='visible';



	} catch(ex) {}

	

}













function rolloutMe(a)

{

	

try {	

	D("name_" + a).className ='investor_anaylst_name';

	D("company_" + a).className ='investor_anaylst_name';

	D("email_" + a).className ='investor_anaylst_name';

	D("arrow_" + a).style.visibility ='hidden';

  	} catch(ex) {}

}





function show_by_type(type){

for(i=1;i<=4;i++){

    var str="";

    if(i!=type){

        str="main_"+i;

        var obj=document.getElementById(str);

        if(obj){

        obj.style.display='none';

        }

    }

}

        str="main_"+type;

        var obj=document.getElementById(str);

       

        if(obj){

        obj.style.display='inline';

         

        }

}



function show_by_step(step){

for(i=1;i<=3;i++){

    var str="";

    var str2="";

    if(i!=step){

        str="step"+i;

        str2="anchors"+i;

        var obj=document.getElementById(str);

        if(obj){

        obj.style.display='none';

        cngbg(str2,'investor_sublink');

        }

    }

}

        str="step"+step;

        str2="anchors"+step;

        var obj=document.getElementById(str);

        

        if(obj){

        obj.style.display='inline';         

        }

         cngbg(str2,'investor_sublinksel');

}





function toggle_css(num){

var objcss=document.getElementById('arabicoverride2');

if(objcss){

    if(num==0){

    objcss.href='css/takecare.css';

    }else{

    objcss.href='css/blank.css';

    }

    }

}







function removeAllOptions(selectbox)

{

var i;

for(i=selectbox.options.length-1;i>=0;i--)

{

selectbox.remove(i);

}

}



function addOption(selectbox,text,value )

{

var optn = document.createElement("OPTION");

optn.text = text;

optn.value = value;

selectbox.options.add(optn);

}



          function check_email(email_txt){

                emailRegExp = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/;              

                if(emailRegExp.test(email_txt)){

                    //alert('true');

                    return true;

               }else{



                 //alert('false');

                  return false;

             }

         }

         

function validate_email(obj){

		if(obj && obj.value){

			if(check_email(obj.value)==false){

				alert(" please enter a valid  email");

				obj.value="";

				obj.select();

				return "no";			

				

			}

			return "yes";

		}

		return "no";

}

function validate_email_ar(obj){

		if(obj && obj.value){

			if(check_email(obj.value)==false){

				alert("'D1,'! '/.'D 'D(1J/ 'D'DC*1HFJ (4CD 5-J-");

				obj.value="";

				obj.select();

				return "no";			

				

			}

			return "yes";

		}

		return "no";

}



function GetFormUri(FormName){

					

						var str="";

						for(var i= 0; i < FormName.length; i++){

						//alert(FormName[i].type+"="+FormName[i].value);

						switch(FormName[i].type)

						{

						  case 'text':

						 	 	if (FormName[i].name!="")

						    	 str=str+encodeURIComponent(FormName[i].name)+"="+encodeURIComponent(FormName[i].value)+"&";

						   	break;

						   	

						    case 'textarea': 

						     	if (FormName[i].name!="")

						   	      	str=str+encodeURIComponent(FormName[i].name)+"="+encodeURIComponent(FormName[i].value)+"&";

						      	break;

							      case 'password':

							      	if(FormName[i].name!="")

							      	  str=str+encodeURIComponent(FormName[i].name)+"="+encodeURIComponent(FormName[i].value)+"&";

							      	break;

							      case 'hidden':

							      	if(FormName[i].name!="")

							      	  str=str+encodeURIComponent(FormName[i].name)+"="+encodeURIComponent(FormName[i].value)+"&";

							      	break;

							      case 'file':

							      	if(FormName[i].name!="")

							      	  str=str+encodeURIComponent(FormName[i].name)+"="+encodeURIComponent(FormName[i].value)+"&";

							        break;

							      case 'checkbox':

							      	

									if (FormName[i].value != ""){

										var objcheck=FormName[i];

										if(objcheck.checked)

										  str=str+encodeURIComponent(objcheck.name)+"="+encodeURIComponent(objcheck.value)+"&";

											

									}      	

									break;

							      case 'select-one':

									if (FormName[i].value != "" ){

										var objselect=FormName[i];

										str=str+encodeURIComponent(objselect.name)+"="+encodeURIComponent(objselect.value)+"&";

									}

							        break;

							      case 'select-multiple':

							      	if (FormName[i].selectedIndex != -1 ){

										var objselect=document.frmtest[0];

										var objoptions=objselect.options;	

										var lensel=objselect.options.length;	

										for(var j=0;j<lensel;j++){

											if(objoptions[j].selected)

												str=str+encodeURIComponent(objselect.name)+"="+encodeURIComponent(objoptions[j].value)+"&";					

										}

							      	}

									break;

								  case 'radio':

								  	var objrd=FormName[i];

								  	if(objrd.checked)

								  		  	str=str+encodeURIComponent(objrd.name)+"="+encodeURIComponent(objrd.value)+"&";

								  	break;	

							      

							    }

						  	}

						  	var newlen=str.length;

						  	str=str.substring(0,newlen-1);		

						  	//alert(str);				  	

						  	return str;						  	

				}

			

			

			

			function make_role(id,numb){

			

			var obj=document.getElementById(id);

			if(obj){

			if(numb==1){

			    obj.src='images/arr2.gif';

			}

			else{

			    obj.src='images/nothing.gif';

			}

			}

			

			}	


                function cngbg0(obj1,nc1){
	                var objv1=document.getElementById(obj1);	
	               
	                if(objv1){
		                objv1.nc1=objv1.className;
		                objv1.className=nc1;		
	                }
	                objv1.onmouseout=function(){ this.className=this.nc1; }
                }
			

			function cngbg(obj1,nc1){
                 
	        var objv1=document.getElementById(obj1);	
                //alert(objv1.className);
	        if(objv1){
		        objv1.nc1=objv1.className;
		        objv1.className=nc1;		
                
	        }



        }

 /**********************************************************************************************************/       
         var currentpage2=1;
         var currentrec2=1;
function show_by_page2(gg,page,pages,total){

    for(i=1;i<=total;i++){

        var str="";    

              str="news_"+i;        

            var obj=document.getElementById(str);

            if(obj){
            obj.style.display='none';
          }

    }
    for(i=1;i<=pages;i++){

        var str2="";    
            str2="anchorss_"+i;        

            cngbg(str2,'indexor');
    }
    str2="anchorss_"+(gg);

    cngbg(str2,'indexor_r');
    var myloppfrom=(page);

    var myloppto=myloppfrom+9;

    for(i=myloppfrom;i<=myloppto;i++){

        var str="";    
            str="news_"+i;        

            var obj=document.getElementById(str);

            if(obj){
            obj.style.display='block';
            }
    }

}

function set_vars2(gg,page){

    currentpage2=gg;

    currentrec2=page;

}

function do_next2(pages,total){

if(currentpage2<pages){

    currentpage2+=1;

    currentrec2+=10;

    show_by_page2(currentpage2,currentrec2,pages,total);

}

}
function do_prev2(pages,total){

if(currentpage2>1){

    currentpage2-=1;

    currentrec2-=10;

    show_by_page2(currentpage2,currentrec2,pages,total);

}

}
        
        
/**********************************************************************************************************************/
function show_by_page(gg,page,pages,total){

    for(i=1;i<=total;i++){

        var str="";    

              str="divsearch_"+i;        

            var obj=document.getElementById(str);

            if(obj){
            obj.style.display='none';
          }

    }
    for(i=1;i<=pages;i++){

        var str2="";    
            str2="anchorss_"+i;        

            cngbg(str2,'indexor');
    }
    str2="anchorss_"+(gg);

    cngbg(str2,'indexor_r');
    var myloppfrom=(page);

    var myloppto=myloppfrom+9;

    for(i=myloppfrom;i<=myloppto;i++){

        var str="";    
            str="divsearch_"+i;        

            var obj=document.getElementById(str);

            if(obj){
            obj.style.display='block';
            }
    }

}

function set_vars(gg,page){

    currentpage=gg;

    currentrec=page;

}

function do_next(pages,total){

if(currentpage<pages){

    currentpage+=1;

    currentrec+=10;

    show_by_page(currentpage,currentrec,pages,total);

}

}
function do_prev(pages,total){

if(currentpage>1){

    currentpage-=1;

    currentrec-=10;

    show_by_page(currentpage,currentrec,pages,total);

}

}



indg=0;

function __anim() {

	clearTimeout(int_id);	
    //alert(cur_y);
	// we animate on cur_x, and then we set it to the object itself

	cur_y += (target_y - cur_y) * 0.3;	

	if (Math.abs(target_y - cur_y) < 5) {

		cur_y = target_y;		

	}	

	cur_y = Math.floor(cur_y); // divs don't have decimal positions, so we need the integer part only		

	var obj = D("projectsholder");
    //alert(obj);
	obj.style.top = cur_y + "px";	

	if (cur_y != target_y) {

		// we're still not quite there yet, so repeat the animation call.

		int_id = setTimeout(__anim, speed);

	} else {		

	

	}	

}

function D(n) { return document.getElementById(n); }


try {

	if (menudef) {}

} catch(ex) {

	menudef = 0;

}





function show_none(id){
document.getElementById(id).style.display='none';
}
function show_block(id){
document.getElementById(id).style.display='block';
}

function do_inner(id,cont){
    var obj=document.getElementById(id);
    if(obj){
    obj.innerHTML=cont;
    }

}



function getFlashMovieObject(movieName)
{


  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
  
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}


function startplayer(id) {
  
    var flash =getFlashMovieObject(id); 
    
    //flash.flashFunction();
   // alert(flash);
}    


function hide_all_pro(indo,total){

    for(j=indo;j<indo;j++){
        var obj=document.getElementById('project_'+(j));
        if(obj){
            obj.style.display='none';
        }
    }
    for(j=(indo+3);j<=total;j++){
        var obj=document.getElementById('project_'+(j));
        if(obj){
            obj.style.display='none';
        }
    }    
}

function play_with_array(indo,total){
for(i=indo;i<indo+3;i++){
var obj2=document.getElementById('project_'+(i));
if(obj2){
obj2.style.display='block';
}
}
hide_all_pro(indo,total);

}

/*************************************************************************/


function d_print(){
var str_p="d_print.aspx"+window.location.hash;
window.open(str_p);

}

function s_print(xx){
var str_p="d_print.aspx?search="+xx;
window.open(str_p);

}

function sp_print(xx){
var str_p="d_print.aspx?"+xx;
window.open(str_p);

}
