﻿var x 
var y
var i = 0
function mouseMove(e) {
try {
if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
		x =  event.x+document.documentElement.scrollLeft ; 
		y =  event.y+document.documentElement.scrollTop ; 
	} else {
	
		x = e.pageX ;
		y = e.pageY ;
	}
    } catch(ex) {}	
}
document.onmousemove=mouseMove;
//---------------------------------------------------------------------//
function showAgenda(id){
    var AgendaDiv = document.getElementById('AgendaDiv');
    if  (AgendaDiv.style.display != 'block'){
        iframeHTML='\<iframe id="Agendawin" scrolling="0" allowtransparency="true" src="" frameborder="0" style="';
        iframeHTML+='border:0px;';
        iframeHTML+='width:100%;';
        iframeHTML+='height:250px;';
        iframeHTML+='"><\/iframe>';     
        AgendaDiv.innerHTML =  iframeHTML;   
        AgendaDiv.style.display = 'block' ;
        AgendaDiv.style.top = (y-50) + 'px' ;
        
        //resizeParent
        if (x>=(document.body.clientWidth-200)){
            AgendaDiv.style.left= (x-20) + 'px';
        }
        else {
            AgendaDiv.style.left= (x-20) + 'px';
        }
        document.getElementById('Agendawin').src = '/17,' + id + ',00,00.aspx';
    }
    else {
        AgendaDiv.style.display = 'none';
        document.getElementById('Agendawin').src = '';    
    }
}
function hideme(){
    var AgendaDiv = document.getElementById('AgendaDiv');
    AgendaDiv.style.display = 'none';
    document.getElementById('Agendawin').src = ''
}

function swf(w,h,source,ID){
        document.write('<object ')
        document.write('classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="loader"')
        document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"" ')
        document.write('width="'+ w +'"')
        document.write('height="'+ h +'">')
        document.write('<param name="movie" value="'+ source +'" />')
        document.write('<param name="FlashVars" value="imageURL='+ ID +'">')
        document.write('<param name="wmode" value="transparent" />')
        document.write('<param name="quality" value="high" />')
        document.write('<param name="menu" value="false" />')
        document.write('<embed wmode="transparent" ')
        document.write('src="'+ source +'" quality="high" ')
        document.write('width="'+ w +'" menu="no" ')
        document.write('height="'+ h +'" ')
        document.write('allowScriptAccess="sameDomain" FlashVars="imageURL='+ ID +'" ')
        document.write('type="application/x-shockwave-flash" ')
        document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />')
        document.write('</object>')
}
/* Open Hi Jack live window */
var popup = null;
function openCustomPopup(location, height, width) {
           var win;
           win = window.open("http://www.hijack.gr/live.aspx", "mplayer", "width=380,height=420,personalbar=yes,locationbar=yes,status=no,titlebar=no, left=400, top=250, screenX=50,screenY=100");
}

function youtubevideo(youtubeurl){
    document.write('<object ')
    document.write('classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ')
    document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ')
    document.write('width="315"')
    document.write('height="250">')
    document.write('<param name="movie" value="'+ youtubeurl +'" />')
    document.write('<param name="wmode" value="transparent" />')
    document.write('<embed src="'+ youtubeurl +'" quality="high" bgcolor="#000000" ')
    document.write('width="315" ')
    document.write('height="250" ')
    document.write('allowScriptAccess="sameDomain" ')
    document.write('type="application/x-shockwave-flash" ')
    document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />')
    document.write('</object>')
}
function ChangeVideo(youtubeurl,title){
    var video;
    video =  '<object '
    video += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '
    video += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '
    video += 'width="315"'
    video += 'height="250">'
    video += '<param name="movie" value="'+ youtubeurl +'" />'
    video += '<param name="wmode" value="transparent" />'
    video += '<embed src="'+ youtubeurl +'" quality="high" bgcolor="#000000" '
    video += 'width="315" '
    video += 'height="250" '
    video += 'allowScriptAccess="sameDomain" '
    video += 'type="application/x-shockwave-flash" '
    video += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />'
    video += '</object>'
    
    document.getElementById("ctl00_ContentPlaceHolder1_selectedVideoDiv").innerHTML = video;
    document.getElementById("ctl00_ContentPlaceHolder1_selectedVideoTitle").innerHTML = title;
}
function AudioPlayer(params){
        audio  = '<object '
        audio += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="loader"'
        audio += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"" '
        audio += 'width="370"'
        audio += 'height="40">'
        audio += '<param name="movie" value="/swf/AudioPlayer.swf" />'
        audio += '<param name="FlashVars" value="'+ params +'">'
        audio += '<param name="wmode" value="transparent" />'
        audio += '<param name="quality" value="high" />'
        audio += '<param name="menu" value="false" />'
        audio += '<embed wmode="transparent" '
        audio += 'src="/swf/AudioPlayer.swf" quality="high" '
        audio += 'width="370" menu="no" '
        audio += 'height="40" '
        audio += 'allowScriptAccess="sameDomain" FlashVars="'+ params +'" '
        audio += 'type="application/x-shockwave-flash" '
        audio += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />'
        audio += '</object>'
        
        document.getElementById("ctl00_ContentPlaceHolder1_selectedAudioDiv").innerHTML = audio;        
        
}
function ChangeVodcasts(params){
        vodcasts  = '<object '
        vodcasts += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="loader"'
        vodcasts += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"" '
        vodcasts += 'width="320"'
        vodcasts += 'height="240">'
        vodcasts += '<param name="movie" value="/swf/vodcasts.swf" />'
        vodcasts += '<param name="FlashVars" value="'+ params +'">'
        vodcasts += '<param name="wmode" value="transparent" />'
        vodcasts += '<param name="quality" value="high" />'
        vodcasts += '<param name="menu" value="false" />'
        vodcasts += '<embed wmode="transparent" '
        vodcasts += 'src="/swf/vodcasts.swf" quality="high" '
        vodcasts += 'width="320" menu="no" '
        vodcasts += 'height="240" '
        vodcasts += 'allowScriptAccess="sameDomain" FlashVars="'+ params +'" '
        vodcasts += 'type="application/x-shockwave-flash" '
        vodcasts += 'pluginspage="http://www.macromedia.com/go/getflashplayer" />'
        vodcasts += '</object>'
        
        document.getElementById("ctl00_ContentPlaceHolder1_selectedAudioDiv").innerHTML = vodcasts;
}
function Contest(w,h,source,params){
        document.write('<object ')
        document.write('classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="loader"')
        document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"" ')
        document.write('width="'+ w +'"')
        document.write('height="'+ h +'">')
        document.write('<param name="movie" value="'+ source +'" />')
        document.write('<param name="FlashVars" value="'+ params +'">')
        document.write('<param name="wmode" value="#FFF" />')
        document.write('<param name="quality" value="high" />')
        document.write('<param name="menu" value="false" />')
        document.write('<embed wmode="#FFF" ')
        document.write('src="'+ source +'" quality="high" ')
        document.write('width="'+ w +'" menu="no" ')
        document.write('height="'+ h +'" ')
        document.write('allowScriptAccess="sameDomain" FlashVars="'+ params +'" ')
        document.write('type="application/x-shockwave-flash" ')
        document.write('pluginspage="http://www.macromedia.com/go/getflashplayer" />')
        document.write('</object>')
}





/* ===== 
 * @fileoverview Share and vote widgets for common Social Networks
 * @author <a href="mailto:info@pagit.eu">Paolo Geninatti</a>
 * @version 1.1.0
 * =====
 */

stdShare = function(type) {
	if (type == 'facebook') {
		share_url = 'http://www.facebook.com/sharer.php?u=' + SWSettings.url + '&title=' + SWSettings.title;
		window.open(share_url);
	} else if (type == 'twitter') {
		share_url = 'http://twitter.com/home?status=' + SWSettings.url + '&title=' + SWSettings.title;
		window.open(share_url);
	} else if (type == 'linkedin') {
		share_url = 'http://www.linkedin.com/shareArticle?mini=true&url=' + SWSettings.url + '&title=' + SWSettings.title;
		window.open(share_url);
	} else if (type == 'myspace') {
		share_url = 'http://www.myspace.com/Modules/PostTo/Pages/?l=3&u=' + SWSettings.url + '&title=' + SWSettings.title;
		window.open(share_url);
	} else if (type == 'delicious') {
		share_url = 'http://del.icio.us/post?url=' + SWSettings.url + '&title=' + SWSettings.title;
		window.open(share_url);
	} else if (type == 'google') {
		share_url = 'http://www.google.com/bookmarks/mark?op=edit&bkmk=' + SWSettings.url + '&title=' + SWSettings.title;
		window.open(share_url);
	} 
}

fbShare = function(id, style) {
    container = document.getElementById(id);
	try {
	 	container.innerHTML = "<a name='fb_share' type=" + style + " share_url=" + SWSettings.url + " href='http://www.facebook.com/sharer.php'>Share</a>";
	} catch(e) {
//		var s = document.createElement('script');
//		s.setAttribute('type','text/javascript');
//		s.setAttribute('src','http://static.ak.fbcdn.net/connect.php/js/FB.Share');
//		container.appendChild(s);	
		var a = document.createElement('a');
		a.setAttribute('name','fb_share');
		a.setAttribute('type', style );
		a.setAttribute('share_url', SWSettings.url);
		a.setAttribute('href', 'http://www.facebook.com/sharer.php');
		a.appendChild(document.createTextNode('Share'));
		container.appendChild(a);
	}
}

fbLike = function(id, style, width, text, color, height) {
    container = document.getElementById(id);
	try {
	 	container.innerHTML = "<iframe src='http://www.facebook.com/plugins/like.php?href=" + SWSettings.url + "&layout=" + style + "&show_faces=true&width=" + width + "&action=" + text + "&colorscheme=" + color + "&height=" + height + "' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:" + width + "px; height:" + height + "px'></iframe>";
	} catch(e) {
		var i = document.createElement('iframe');
		var src = "http://www.facebook.com/plugins/like.php?href=" + SWSettings.url + "&layout=" + style + "&show_faces=true&width=" + width + "&action=" + text + "&colorscheme=" + color + "&height=" + height + "";
		i.setAttribute('src', src);
		i.setAttribute('scrolling','no');
		i.setAttribute('frameborder', '0');
		var sstyle = 'border:none; overflow:hidden; width:' + width + 'px; height:' + height + 'px';
		i.setAttribute('style', sstyle);
		i.setAttribute('allowTransparency','"true"');
		container.appendChild(i);
	}
}

twTweet = function(id, style, source) {
    container = document.getElementById(id);
	try {
		if (source != '')
			data_via = "data-via="+source;
		else
			data_via = "";
	 	container.innerHTML = "<a href='http://twitter.com/share' class='twitter-share-button' data-text=" + SWSettings.title + " data-url=" + SWSettings.url + " data-count=" + style + data_via + ">Tweet</a>";
	} catch(e) {	
//		var s = document.createElement('script');
//		s.setAttribute('type','text/javascript');
//		s.setAttribute('src','http://platform.twitter.com/widgets.js');
//		container.appendChild(s);	
		var a = document.createElement('a');
		a.setAttribute('href', 'http://twitter.com/share');
		a.setAttribute('class','twitter-share-button');
		a.setAttribute('data-text', SWSettings.title);
		a.setAttribute('data-url', SWSettings.url); 
		a.setAttribute('data-count', style);
		if (source != '')
			a.setAttribute('data-via', source);
		a.appendChild(document.createTextNode('Tweet'));
		container.appendChild(a);
	}
}
