// Add CSS in head
	var css = "http://emea.trendmicro.com/css/common/colorbox/colorbox.css";
	$("head").append('<link rel="stylesheet" type="text/css" href="'+css+'"/>');
document.write('<script type="text/javascript" src="http://emea.trendmicro.com/jscript/common/lib/jquery/colorbox/jquery.colorbox-min.js"><\/script>');
$(document).ready(function(){
	var zaehler = 1;
var trialtypes = /\/products\/sb\/worry-free-business-security\/download/i;
       $('a').each(function(){
           var href = $(this).attr('href');
			if(href != undefined) {
				if (href.match(trialtypes)){
					// change links
					var filePath = $(location).attr('href');
					filePath_Array = filePath.split(".");
					if (filePath_Array[2] != undefined) {
					
						lang_Array = filePath_Array[2].split("/");
						
						if (filePath_Array[3] != undefined) {
							if (filePath_Array[3] == 'uk') {lang_Array = filePath_Array[3].split("/");}
							else if (filePath_Array[3].match(/tr\//i)) {lang_Array = filePath_Array[3].split("/");}
						}
						
						if (lang_Array[0] == "be") {lang_Array[0] = lang_Array[1];};
						
						$(this).attr('href', 'http://emea.trendmicro.com/emea/sso/wf_std_'+lang_Array[0]+'.php');
					} else {
						$(this).attr('href', 'http://emea.trendmicro.com/emea/sso/wf_std_uk.php');
					}
					//add classes
					var klasse = 'link'+zaehler;
					$(this).addClass(klasse);
					zaehler++;
					//add colorbox
					$('.'+klasse).colorbox({width:"600px", height:"450px", iframe:true});
					//tracking?
	            }
            }
        });
});


function  getUrlVars(ref) {
   var vars = {};
   var parts = ref.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
       vars[key] = value;
   });
   return vars;
}
