$(document).ready(function() {

	 ddsmoothmenu.init({
    	mainmenuid: "naviset_dropdown", //menu DIV id
    	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
    	classname: 'ddsmoothmenu', //class added to menu's outer DIV
    	//customtheme: ["#1c5a80", "#18374a"],
	    contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    });
  

	$("a[href$=.jpg],a[href$=.png],a[href$=.gif]").fancybox({
		'titleShow'     : true,
		'titlePosition'  : 'over'
	});
	
   $(".main-content").nifty("same-height");
 
   $('.xmain-content').bxSlider({
	        alignment: 'horizontal',         // 'horizontal', 'vertical' - direction in which slides will move
	        controls: true,               // determines if default 'next'/'prev' controls are displayed
	        speed: 500,                    // amount of time slide transition lasts (in milliseconds)
	        margin: 0,                     // if 'horizontal', applies a right margin to each slide, if 'vertical' a
	        auto: true,                    // determines if slides will move automatically
	        pause: 8000,                   // time between each slide transition (auto mode only)
	        auto_direction: 'next',        // order in which slides will transition (auto mode only)
	        auto_hover: true,              // determines if slideshow will pause while mouse is hovering over slideshow
	        auto_controls: true,          // determines if 'start'/'stop' controls are displayed (auto mode only)
	        ticker: false,                 // determines if slideshow will behave as a constant ticker
	        ticker_controls: true,        // determines if 'start'/'stop' ticker controls are displayed (ticker mode only)
	        ticker_direction: 'next',      // order in which slides will transition (ticker mode only)
	        ticker_hover: true,            // determines if slideshow will pause while mouse is hovering over slideshow
	        wrapper_class: 'bxslider_wrap' // class name to be used for the outer wrapper of the slideshow
	  });

});

function _set_search_form(t,tt){
  
  var b,f;
  
  try {
    f = document.createElement('<input type="text" value="" name="mwsearch" size="10" id="searchfield" autocomplete="off" />');
    b = document.createElement('<input type="submit" value="' + t + '" title="' + tt + '" id="searchbutton" />');
    
  } catch (e) {
    f = document.createElement("input");
    f.setAttribute("type", "text");
    f.setAttribute("name", "mwsearch");
    f.setAttribute("value", "");
    f.setAttribute("size", "10");
    f.setAttribute("id", "searchfield");
    f.setAttribute("autocomplete", "off");
    
    b = document.createElement("input");
    b.setAttribute("type", "submit");
    b.setAttribute("value", t);
    b.setAttribute("title", tt);
    b.setAttribute("id", "searchbutton");
   
  }
  
  var p = document.getElementById('search_form');
  
 if(p && f && b){ 
    p.appendChild(f);
    p.appendChild(b);
  }
}

function _set_custom_focus(){
 var f = document.getElementById('searchfield');
 
 if(f){
   f.focus();	
 }
}

function getswf(id,param,w,h,play,loop,bg)
{
 	if (AC_FL_RunContent == 0) {
		alert('Error - script not found');
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', w ,
			'height', h ,
			'src', param,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', play ,
			'loop', loop ,
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', id ,
			'bgcolor', bg,
			'name', id ,
			'menu', 'false',
			'allowScriptAccess','sameDomain',
            'movie', param,
			'salign', ''
			); 
	}

}


/* AJAX */
function setdisplay(str){

	var mySplitResult = str.split(" ");

	for(i = 0; i < mySplitResult.length; i++){
		var row = document.getElementById(mySplitResult[i]);
		if (row.style.display == '') row.style.display = 'none';
		else row.style.display = '';
	}
}



