// Language dropdown div fix for IE6
sfHover = function() {
	if (chkObject('language-dropdown')) {
		var sfEls = document.getElementById("language-dropdown").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" lihover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" lihover\\b"), "");
			}
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
// opening links in new window 
$(document).ready(function() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
	   var anchor = anchors[i];
	   if (anchor.getAttribute("href") &&
		   anchor.getAttribute("rel") == "external")
		 anchor.target = "_blank";
	 }
})
/* a function to do some fixes in safari */
$(document).ready(function() {
	if (/safari/i.test(navigator.userAgent)) {
		loadjscssfile("/StaticFiles/DWTC Arabic Contents/System Files/css/safari.css", "css") ////dynamically load and add this .css file
	}
	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){ 
 		 var ffversion=new Number(RegExp.$1)
		 if (ffversion<3)
			loadjscssfile("/StaticFiles/DWTC Arabic Contents/System Files/css/firefox2.css", "css") ////dynamically load and add this .css file	 	
	}
})
/* function to initialize pretty photo in all pages */

	$(document).ready(function(){
		if($("a[rel^='prettyPhoto']").length > 0) {
			$("a[rel^='prettyPhoto']").prettyPhoto({
				animationSpeed: 'normal', /* fast/slow/normal */
				padding: 4, /* padding for each side of the picture */
				opacity: 0.7, /* Value betwee 0 and 1 */
				showTitle: false, /* true/false */
				allowresize: true, /* true/false */
				counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */
				theme: 'light_square', /* light_rounded / dark_rounded / light_square / dark_square */
				callback: function(){}
			});
		}
	});
